-
Notifications
You must be signed in to change notification settings - Fork 0
/
first.py
24 lines (16 loc) · 864 Bytes
/
first.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from windows import ManagedWindow
class FirstTab(ManagedWindow):
def __init__(self, name, window_manager):
super().__init__(name, 'first.ui', window_manager)
def bind(self, controller):
# Simple binding between text in textEdit and 'text' data field
self.bind_lineEdit(controller, 'text', self.textEdit)
# Example of a custom listener. Whenever 'text' field in the state
# changes, the text on advancedButton will change too.
controller.listen('text', self.advancedButton.setText)
# Calling some code from the controller on click
self.runButton.clicked.connect(controller.run)
# Using window manager to show another window
self.advancedButton.clicked.connect(self.window_manager['second'].show)
def closeEvent(self, event):
self.window_manager.close_all()