socek

Untitled

May 30th, 2013
986
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. import sys
  4. from PySide import QtGui
  5.  
  6.  
  7. def new_window():
  8.     global wid2
  9.     wid2 = QtGui.QWidget()
  10.     wid2.resize(250, 150)
  11.     wid2.setWindowTitle(u'Drugie okno')
  12.     wid2.show()
  13.  
  14. app = QtGui.QApplication(sys.argv)
  15.  
  16. wid = QtGui.QWidget()
  17. wid.resize(250, 150)
  18. wid.setWindowTitle('Simple')
  19. wid.show()
  20.  
  21.  
  22. button = QtGui.QPushButton(u'Nowe okno')
  23. button.clicked.connect(new_window)
  24.  
  25. layout = QtGui.QVBoxLayout(wid)
  26. layout.addWidget(button)
  27.  
  28. sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment