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.
Create lists to select from - Python Tutorial
From the course: Rapid Application Development with Python
Create lists to select from
- [Instructor] List boxes are used to hold a set of items, one or more of which can be selected and typically appear as a scrollable list. I've preloaded the code to create a list box at line eight. The choices clause at line nine creates the list with an initial set of items. At line 10, the list box is styled with a horizontal scroll, allows just one entry to be selected and is sorted. At line 11, I've positioned and sized the list box to fit on the panel. Having created the list box at line 12, I set the initial selection to the top of the list. Let's update the action taken by the testing button. In this event handler, I'll comment out the original print line. And I'll get the selected list box item. Listno equals self.lb_test.GetSelection. And I'll display its value. Print self.lb_test.GetString of the currently selected item, listno. Plus lives in Valhalla. When we run this, the list is 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
-
-
-
-