-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
25 lines (21 loc) · 676 Bytes
/
Copy pathrun.py
File metadata and controls
25 lines (21 loc) · 676 Bytes
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
# -*- coding: utf-8 -*-
import sys
from qbcompiler.gui.main_window import QBCompilerApp
def main():
app = QBCompilerApp()
# Safe close protocol
def on_closing():
if app.compiler.is_building:
from tkinter import messagebox
confirm = messagebox.askyesno(
"Build in Progress",
"A build is currently running in the background. Stop compilation and exit?"
)
if not confirm:
return
app.compiler.cancel_build()
app.destroy()
app.protocol("WM_DELETE_WINDOW", on_closing)
app.mainloop()
if __name__ == "__main__":
main()