Python Forum
Tkinter - Need Help setting Height of a TextInputBox
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.
Reply
#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?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Tkinter reduce OptionMenu height euras 2 4,569 May-25-2021, 09:14 PM
Last Post: euras
  [Tkinter] Help setting text/title in dock/panel in tkinter gui FluxApex 2 4,351 Mar-18-2020, 07:15 PM
Last Post: FluxApex
  [Tkinter] Lock Text Widget height Oxylium 3 4,167 Feb-14-2019, 10:13 PM
Last Post: woooee
  Canvas Text Width/Height Anysja 0 5,125 Aug-20-2018, 11:11 PM
Last Post: Anysja
  [Tkinter] TkInter Setting Out Project MTom5 1 2,199 Aug-14-2018, 04:08 PM
Last Post: Larz60+
  [Tkinter] Scroll bar height is not fixed with Text widget MeeranRizvi 2 15,383 Feb-06-2017, 12:24 PM
Last Post: MeeranRizvi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020