December 2015
Beginner to intermediate
350 pages
6h 49m
English
In tkinter, the typical textbox widget is called Entry. In this recipe, we will add such an Entry to our GUI. We will make our label more useful by describing what the Entry is doing for the user.
This recipe builds upon the Creating buttons and changing their text property recipe.
# Modified Button Click Function # 1 def clickMe(): # 2 action.configure(text='Hello ' + name.get()) # Position Button in second row, second column (zero-based) action.grid(column=1, row=1) # Changing our Label # 3 ttk.Label(win, text="Enter a name:").grid(column=0, row=0) # 4 # Adding a Textbox Entry widget # 5 name = tk.StringVar() # 6 nameEntered = ttk.Entry(win, width=12, textvariable=name) # 7 nameEntered.grid(column=0, ...
Read now
Unlock full access