Last active
June 27, 2017 03:21
-
-
Save Dayof/b47a18325d7af75708d74fd0c569f0a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import toga | |
class StartApp(toga.App): | |
def startup(self): | |
self.main_window = toga.MainWindow(self.name, size=(200, 200)) | |
self.main_window.app = self | |
self.h_button = toga.Button('Hide Stub', | |
on_press=self.callbackHideLabel) | |
self.s_button = toga.Button('Show Stub', | |
on_press=self.callbackShowLabel) | |
self.label_box = toga.Box() | |
self.label_stub = toga.Label('Stub') | |
self.label_box.add(self.label_stub) | |
self.outer_box = toga.Box() | |
self.outer_box.add(self.label_box) | |
self.outer_box.add(self.h_button) | |
self.outer_box.add(self.s_button) | |
self.main_window.content = self.outer_box | |
self.main_window.show() | |
def callbackHideLabel(self, button): | |
self.label_box.hide() | |
def callbackShowLabel(self, button): | |
self.label_box.show() | |
app = StartApp('Hide or Show a Box Widget', 'org.pybee.tests') | |
app.main_loop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment