1234567891011121314151617181920212223 |
- import sys
- from PyQt5.QtWidgets import *
-
- class MyWindow(QMainWindow):
- def __init__(self):
- super().__init__()
- self.initUI()
-
- def initUI(self):
- self.setWindowTitle("SWH")
-
- button = QPushButton("눌러봐", self)
- button.move(50, 30)
- button.clicked.connect(self.pressed)
-
- def pressed(self):
- QMessageBox.about(self, "메세지 박스", "눌렀어요.")
-
- if __name__ == "__main__":
- app = QApplication(sys.argv)
- window = MyWindow()
- window.show()
- sys.exit(app.exec_())
|