-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI.py
90 lines (60 loc) · 2.01 KB
/
GUI.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import sys
from PyQt4 import QtGui, QtCore
from PyQt4 import Qt
from PyQt4.QtGui import QWidget
from gui2 import Window2
class Window(QtGui.QMainWindow):
def __init__(self):
super(Window,self).__init__()
self.connect(self, Qt.SIGNAL('triggered()'), self.closeEvent)
self.setGeometry(50,50,500,300)
self.setWindowTitle("MusiclyApp")
action = QtGui.QAction("&Add Playlist" , self)
action.setStatusTip("adding playlist")
action.triggered.connect(self.closeEvent)
self.statusBar()
menu = self.menuBar()
PlaylistMenu = menu.addMenu("&PlayList")
PlaylistMenu.addAction(action)
self.home()
def home(self):
btn = QtGui.QPushButton("Pick", self)
btn.clicked.connect(self.link)
btn.resize(btn.sizeHint())
btn.move(200,200)
btn2 = QtGui.QPushButton("link", self)
btn2.clicked.connect(self.link)
btn2.resize(btn.sizeHint())
btn2.move(300, 200)
self.le = QtGui.QLineEdit(self)
self.btn1 = QtGui.QPushButton("get name",self)
self.btn1.clicked.connect(self.gettext)
arr = {'monica' , 'bt7eb' , 'blala'}
y = 300
i=0
while i<100:
l = QtGui.QLabel("monica",self)
l.move(200,y)
y += 20
i += 1
self.show()
def gettext(self):
text, ok = QtGui.QInputDialog.getText(self, 'Text Input Dialog', 'Enter your name:')
if ok:
# self.le1.setText(str(text))
print(text)
def link(self):
print("3asalya")
self.f = Window2()
self.f.show()
def closeEvent(self,event):
print("7madaa ")
sys.exit()
def pick(self):
name = QtGui.QFileDialog.getOpenFileName(self,'pick file')
print(name)
def main():
app = QtGui.QApplication(sys.argv)
GUI = Window()
sys.exit(app.exec_())
main()