From the course: Rapid Application Development with Python
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Checkboxes and radio buttons - Python Tutorial
From the course: Rapid Application Development with Python
Checkboxes and radio buttons
- [Instructor] Let's take a look at check boxes and radio buttons. I'll be using the wxTest program with the test button includes. Check boxes are used in the GUI to get a binary value, checked or not checked, such as enabling a user to set or unset an option. We can add one onto the panel by entering after line seven. Self dot and I'll call it cb_discount equals wx.CheckBox widget with a parent of the panel and a system-assigned object number. And we'll call the label of the checkbox Apply Discount. And I'll position it at 60, 20. At line 11, we can modify our test button event handler to display the state of the checkbox using the isChecked property of the widget. I'll comment out the original print. And we'll print Checkbox, self.cb_discount.IsChecked. And when we run this, we can check and uncheck the checkbox and we can use the Testing button to retrieve its state. Radio boxes provide a set of one or more…
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
-
-
-
-