Skip to content

Commit 592060d

Browse files
author
SupKittyMeow
committed
Multi window support!
1 parent 53e214f commit 592060d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

main.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def eventFilter(self, obj, event):
6161
self.onMouseDown(event)
6262
elif event.type() == QEvent.Type.MouseButtonRelease:
6363
self.onMouseUp(event)
64+
if event.type() == QEvent.Type.Close:
65+
QApplication.quit()
6466
return False
6567

6668
def onMouseDown(self, event):
@@ -192,7 +194,11 @@ def update_physics(self):
192194
if __name__ == "__main__":
193195
app = QApplication(sys.argv)
194196
refresh_rate = app.primaryScreen().refreshRate()
195-
win = Window()
196-
app.installEventFilter(win)
197-
win.show()
197+
198+
wins = []
199+
for _ in range(1):
200+
wins.append(Window())
201+
for win in wins:
202+
win.show()
203+
win.installEventFilter(win)
198204
app.exec()

0 commit comments

Comments
 (0)