Python Forum
Tkinter - Need Help setting Height of a TextInputBox - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: Tkinter - Need Help setting Height of a TextInputBox (/thread-25158.html)



Tkinter - Need Help setting Height of a TextInputBox - itslewis - Mar-21-2020

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.


RE: Tkinter - Need Help setting Height of a TextInputBox - deanhystad - Mar-22-2020

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?