-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello.py
55 lines (38 loc) · 1.45 KB
/
hello.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import sys
from PySide import QtGui, QtCore
from wordplay.onvertercay import OnverterCay
class ExampleWindow (QtGui.QMainWindow):
def __init__(self):
super(ExampleWindow, self).__init__()
self.initUI()
def initUI(self):
self.statusBar().showMessage('Ready for ducks')
self.ex = Example(self)
self.setCentralWidget(self.ex)
self.setWindowTitle('Pig Latinizer')
self.show()
class Example (QtGui.QWidget):
def __init__(self, parent):
super(Example, self).__init__(parent)
self.mOnverterCay = OnverterCay()
self.initUI()
def initUI(self):
self.xtTay = QtGui.QLineEdit()
okButton = QtGui.QPushButton("Onvertcay")
self.lbl = QtGui.QLabel('test')
okButton.clicked.connect(self.onvertcayText)
vbox = QtGui.QVBoxLayout()
vbox.addWidget(self.xtTay)
vbox.addWidget(self.lbl)
vbox.addWidget(okButton)
self.setLayout(vbox)
#self.setGeometry(10, 10, 300, 150)
#self.setWindowTitle('Pig Latinizer')
#self.show()
def onvertcayText(self):
onvertedcayResult = self.mOnverterCay.onvertCay(self.xtTay.text())
self.lbl.setText(onvertedcayResult)
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
ex = ExampleWindow()
sys.exit(app.exec_())