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.
Labels and buttons - Python Tutorial
From the course: Rapid Application Development with Python
Labels and buttons
- Let's now play some text onto the panel in our test application. We can do this using a static text, which is otherwise known as a label. We can add this line into the top frame initialization immediately after line five, where we create the panel. I went to wx.StaticText, and this will be located on the panel, and we will use a default object identifier, and we'll say, this is static text. Okay, let's run this. And we can see, we now have a label showing on the panel. We can have positional information to this, to place it on the panel where we want it to be. Let's update the text widget to locate it five points in from the left, and 60 points down. And we do this using pos equals (5,60). Now, when we run this, the label is showing where we positioned it on the panel. Placing a button on the panel, there's a bit more work because we need to think about what happens when someone presses the button. We do this with the…
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
-
-
-
-