SHOW:
|
|
- or go back to the newest paste.
| 1 | #!/usr/bin/python | |
| 2 | # -*- coding: utf-8 -*- | |
| 3 | import sys | |
| 4 | from PySide import QtGui | |
| 5 | ||
| 6 | ||
| 7 | def new_window(): | |
| 8 | - | global wid |
| 8 | + | global wid2 |
| 9 | - | wid = QtGui.QWidget() |
| 9 | + | wid2 = QtGui.QWidget() |
| 10 | - | wid.resize(250, 150) |
| 10 | + | wid2.resize(250, 150) |
| 11 | - | wid.setWindowTitle(u'Drugie okno') |
| 11 | + | wid2.setWindowTitle(u'Drugie okno') |
| 12 | - | wid.show() |
| 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_()) |