Dependent Drop Downs and List Boxes - Python Tkinter GUI Tutorial #152

preview_player
Показать описание
In this video I'll show you how to create dependent drop downs, combo boxes, and list boxes for Tkinter.

A Dependent dropdown or listbox is one that changes based on what you clicked in the previous box.

In our example, we'll create a sizes dropdown that has small, medium, and large sizes. When you click on one of them, a second list appears with the colors (red, green, blue, black) that are available for each size.
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:
▶️ Get The Code

Codemycom
Автор

Thank you for making this video. Been studying tkinter, namely the dep drop-down, but there isn't much out there on that topic. I like how you explain each line of code, what it is for, etc. - that helps to understand the nuances of the framework. I am building a Covid metrics display for work, showing data for each county of every state (number of infected each day, aggregate average, etc.), and this GUI piece is critical for the everyday computer user to make selections. Thanks!

vincenzo
Автор

Thank you sir, your videos are really helping me in my gui tkinter project. Keep it up and we are waiting for more such fantastic videos :)

chococandy
Автор

Hi John. Thanks for great videos. Can you make please make a video which shows how to create a toplevel window inside a main window even if i drag it out.

ahmetbayramtoluc
Автор

I just learning about database and I need a way to show item name and the amount of the item. This video help me to do that. So when I choose an item from the first dropdown, the second dropdown will be populated by numbers with the maximum amount is the amount of the item in database.

I will try to combine them later so I can make update or insert function to manipulate the database based on the values of both dropdown.

yafethtb
Автор

hey John thank your wonderful Tkinter login system...video

kelumdissanayaka
Автор

This function is really useful thanks!

As a side note: I have always wondered why we still have to import stuff for Tkinter (eg 'from tkinter import ttk') when we have already imported everything with * (eg 'from tkinter import *')? Seems a bit weird to me. I guess that * refers to all from a basic tkinter package?

Anyways.. keep up the good work!

robh
Автор

This is great video. I tried this for a similar application in abaqus viewer software. Could you please show how to add a text to the left side of the drop down box? Something like to prompt the user on what is expected to be selected in the dropdown.
Also please make a video on how to use the dropdown selection in further code/ application.

vaidehicrs
Автор

Great video!!! I do have a question...How does one change the location of the drop-down box? I tried using .grid but didn't get the results I wanted.

kennethpadgett
Автор

what is "e" that passed to the function? My IDE does not recognize "e")

aguypassingby
Автор

Awesomeee!! How can we pass index number of selection from 1st drop-down list to 2nd drop-down list?
Imagine that we have same number of elements in the size and color lists and want to select 2nd drop-down list automatically via index number of 1st selection.

sibelylmaz
Автор

Is it possible to make the list box dependent on what you choose in a combo box?

Eri
Автор

I have e been looking for this and trying everything I could think of for a week. You’re CN you bind to a SQLite3 DB as well?

kendiener
Автор

This is awesome.. can we bind and make 3 comboboxes and make it dependent.. like state, city and, zip code.. can you help

amitkore
Автор

I am using the same if my_combo.get() = = "Female" and it is not working. (Female is part of my list)

markhillman
Автор

how do i get a copy of your code for each module so that i can just copy paste and run them for practise so i dont make much errors typing eachline of code.
the best tutorials.thanks

ameowingcat
Автор

Hi! Could you help me please, how can i use this widget in kivy? Thank you!

davidvarga
Автор

Any way you could show how to get the drop down to take data from excel

capincrunch
Автор

Is there a reason not to make it a dictionary? Just asking because I genuinely don't know and for all I know using a dictionary could be less efficient or cause other problems.

```
size_color_dict = {
'small': [
'red',
'green',
'blue',
'black'
],
'medium': [
'red',
'green'
],
'large': [
'blue',
'black'
]
}

my_combo = ttk.Combobox(root, value=list(size_color_dict.keys()))
```

johnackelley
Автор

I have some value in a textbox and i want it to get into a Dropdown

DEEPAKTHAKUR-tmtr