|
@@ -45,17 +45,11 @@ class Main(tk.Tk, Table):
|
|
|
|
|
|
|
|
|
print('initializing GUI...')
|
|
|
- container = tk.Frame(self)
|
|
|
- container.pack(side="top", fill="both", expand = True)
|
|
|
- container.grid_rowconfigure(0, weight=1)
|
|
|
- container.grid_columnconfigure(0, weight=1)
|
|
|
-
|
|
|
-
|
|
|
- menubar = tk.Menu(container)
|
|
|
+ menubar = tk.Menu(self)
|
|
|
filemenu = tk.Menu(menubar, tearoff=0)
|
|
|
filemenu.add_command(label="Save settings", command = lambda: self.popupmsg("Not supported just yet!"))
|
|
|
filemenu.add_separator()
|
|
|
- filemenu.add_command(label="Exit", command=quit)
|
|
|
+ filemenu.add_command(label="Exit", command=self.stop)
|
|
|
menubar.add_cascade(label="File", menu=filemenu)
|
|
|
|
|
|
tk.Tk.config(self, menu=menubar)
|
|
@@ -76,9 +70,14 @@ class Main(tk.Tk, Table):
|
|
|
button4 = tk.Button(top,text="Einstellungen",command=lambda: self.show_frame(Page_4))
|
|
|
button4.pack(side=tk.LEFT)
|
|
|
|
|
|
- button5 = tk.Button(top, text="QUIT", fg="red",command=quit)
|
|
|
+ button5 = tk.Button(top, text="QUIT", fg="red",command=self.stop)
|
|
|
button5.pack(side=tk.LEFT)
|
|
|
- top.pack(side="top", expand=True, fill="both")
|
|
|
+ top.pack(side="top", fill="both")
|
|
|
+
|
|
|
+ container = tk.Frame(self)
|
|
|
+ container.pack(side="top", fill="both", expand = True)
|
|
|
+ container.grid_rowconfigure(0, weight=1)
|
|
|
+ container.grid_columnconfigure(0, weight=1)
|
|
|
|
|
|
self.frames = {}
|
|
|
|
|
@@ -92,10 +91,10 @@ class Main(tk.Tk, Table):
|
|
|
|
|
|
self.show_frame(Page_1)
|
|
|
|
|
|
- self.after(5000,self.interval)
|
|
|
-
|
|
|
print('program ready!')
|
|
|
|
|
|
+ self.interval()
|
|
|
+
|
|
|
def show_frame(self, cont):
|
|
|
self.currentFrame = self.frames[cont]
|
|
|
self.currentFrame.tkraise()
|
|
@@ -136,5 +135,6 @@ class Main(tk.Tk, Table):
|
|
|
|
|
|
print("draw: {:8.3f} ms".format((time.time() - start)*1000))
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ def stop(self):
|
|
|
+ self.forceSensors.stop()
|
|
|
+ self.quit()
|