From the course: Rapid Application Development with Python
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Use combo boxes - Python Tutorial
From the course: Rapid Application Development with Python
Use combo boxes
- [Instructor] A combo box is a variation on a list box, and it's useful if only one value is to be selected. At line eight, I've defined the combo box "cb_test," which is a little simpler to code than the list box. At line 11, I've set the initial position to the top of the combo box, as we did for the list box, and at line 12, I've defined an event handler to take action as soon as the combo box selection changes. I've updated the event handler at line 17 to print out the selected value. A combo box can only have one selected value at any one time, so we don't need to get an index to find it. Let's run this. And we see, as I change the selection through the dropdown box, the message is immediately displayed.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Introducing wxPython2m 13s
-
(Locked)
Class-based skeleton4m 37s
-
(Locked)
Labels and buttons3m 38s
-
(Locked)
More on buttons3m 33s
-
(Locked)
Checkboxes and radio buttons6m 43s
-
(Locked)
Text entry controls4m 36s
-
(Locked)
Use spinners to set values4m 58s
-
(Locked)
Create lists to select from6m 9s
-
(Locked)
Use combo boxes54s
-
(Locked)
Compose a menu bar6m 46s
-
(Locked)
Challenge36s
-
(Locked)
Solution2m 54s
-
-
-
-