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

Use spinners to set values - Python Tutorial

From the course: Rapid Application Development with Python

Start my 1-month free trial

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…

Contents