-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.py
37 lines (27 loc) · 1002 Bytes
/
debug.py
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
26
27
28
29
30
31
32
33
34
35
36
37
from config import *
from utils import *
class Debug():
def __init__(self, master):
self.master = master
self.mk_tkinter_box()
def quit_callback(self):
sys.exit()
def mk_tkinter_box(self):
# make root tkinter box
self.root = tkinter.Tk()
self.root.protocol("WM_DELETE_WINDOW", self.quit_callback)
self.main_tk_dialog = tkinter.Frame(self.root)
self.main_tk_dialog.pack()
# add checkbox for draw collision box
def cmd():
self.master.holder.worldClass.draw_collision_boxes = not self.master.holder.worldClass.draw_collision_boxes
cb1_var = tkinter.IntVar()
cb1 = tkinter.Checkbutton(self.root, command=cmd, text="Draw Collision Boxes", variable=cb1_var)
cb1.pack()
def update(self):
try:
self.main_tk_dialog.update()
except:
print("dialog error")
def finish(self):
self.root.destroy()