Tkinter tutorial for beginners #5: Combobox, Listbox

preview_player
Показать описание
Tkinter tutorial for complete beginnners. In this part, learn how to use the Tkinter Combobox and the Tkinter Listbox. Learn Tkinter and Tkinter for GUI design. Learn how to launch and create your first GUI for Python programs and desktop applications.

In this tutorial, you will learn how to create your first Python Graphical User Interface. You will learn about the following widgets: Tkinter Combobox and Tkinter Listbox.

For more info:

Timestamps:
00:00 Introduction and overview
00:32 Starter code
01:52 Themed Widgets
02:55 Combobox - Create a Combobox
06:02 Combobox - Binding Combobox events to functions
08:30 Combobox - Setting Combobox value
09:55 Combox - Setting Combobox to readonly
10:57 Combobox - Changing Combobox list of values
12:09 Listbox - Create a Listbox
16:19 Listbox - Changing Listbox selectmode
16:57 Listbox - Binding Listbox events to functions
20:18 Listbox - Change Listbox height

Socials:

*************
**Tags**
Tkinter tutorial
Tkinter install
Tkinter Setup
Tkinter GUI tutorial
GUI tutorial Python
Graphical User Interface Python
Python tutorial
Tkinter widgets
Tkinter Combobox
Tkinter Listbox
Рекомендации по теме
Комментарии
Автор

I love the way you say "ok" :)🙃

PA-bucs
Автор

combo["values"] = 😍 thank you for these

der_bar
Автор

Thank you so much for another excellent tutorial. Sadly I can't get my the bind bit working.. The window and selectable window are fine, but when a selection was made nothing new happens. I've tried in Thonny and pycharm.
Any advice? - UPDATE: The error below was that I should have written ComboboxSelected (!!), not ComboboxSelectiobn. Tq..

def RunMyUserFn(event):
my_Label = Label(root, text=sel.get()).pack() # label doesn't appear in the window
print("An event was noted") # no console output occurs.

cb1.bind("<<ComboboxSelection>>", RunMyUserFn)

sel = tk.StringVar() # 'sel' is a variable to hold the option clicked on
sel.set(MPA_list[0]) # set first element in list as default combobox display
cb1 = ttk.Combobox(root, values=MPA_list, width=15, textvariable=sel)

cb1.bind("<<ComboboxSelection>>", RunMyUserFn)

kychemclass