Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Tkinter - Need Help setting Height of a TextInputBox
#1
import tkinter as tk
from tkinter import *

gui = Tk(className=' Enter Password.')
password = int("5454")
button_pressed = False
# set window size
gui.geometry("500x200")

gui.resizable(False, False)

tex = Label(gui, text="Enter Your Password...")
tex1 = Text(gui, width=4,height=30)
tex1.insert(tk.END, "Enter your Password to enter your Computer.")
    
tex.pack()
tex1.pack()

gui.mainloop() 

if button_pressed == True:
    # code will be here soon...


When i run the code it does nothing... A Little Help Pweez.
Quote
#2
Once I fixed the error at the end. Either comment out the if or add something to do if button_pressed. Your choice:

if button_pressed == True:
    pass # code will be here soon...
    
# if button_pressed == True:
    # code will be here soon...
When I run the program with that small change I get a funny looking dialog window with a tall, skinny Text widget filled with the text "Enter your Password to enter your Computer."

I don't think you ran the program. If you had, you would know about the syntax error. How did you try to run this program?
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  [Tkinter] Help setting text/title in dock/panel in tkinter gui FluxApex 2 246 Mar-18-2020, 07:15 PM
Last Post: FluxApex
  [Tkinter] Lock Text Widget height Oxylium 3 647 Feb-14-2019, 10:13 PM
Last Post: woooee
  Canvas Text Width/Height Anysja 0 1,319 Aug-20-2018, 11:11 PM
Last Post: Anysja
  [Tkinter] TkInter Setting Out Project MTom5 1 620 Aug-14-2018, 04:08 PM
Last Post: Larz60+
  [Tkinter] Scroll bar height is not fixed with Text widget MeeranRizvi 2 6,689 Feb-06-2017, 12:24 PM
Last Post: MeeranRizvi

Forum Jump:


Users browsing this thread: 1 Guest(s)