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 spinners to set values - Python Tutorial
From the course: Rapid Application Development with Python
Use spinners to set values
- [Instructor] We can combine a text entry field with a spinner using the wx spin button widget. The spin button has two small up and down or left and right arrow buttons and is used to increment and decrement a value. I'll enter a counter field as a text control, self dot and I'll call it tc counter equals wx dot text control self dot panel wx dot ID any. I'll initialize it to one and set its position to 60 comma 100 and its size to 35 comma -1. A note, I'm using the positional parameters to wx text control rather than the key words for the position and the size. I'll now add the spin control to match the entry box size. To do this, I'll first need to calculate the height, hispin equals self dot tc control dot GetSize dot height. And the horizontal position. Position of the spin control, pospin equals self dot tc counter dot GetSize dot width plus self dot tc counter dot GetPosition dot x…
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
-
-
-
-