Browse Source

fixed issue with multiple popups

subDesTagesMitExtraKaese 4 years ago
parent
commit
e312d175c2
1 changed files with 6 additions and 5 deletions
  1. 6 5
      raspberry-pi/gui/mainWindow.py

+ 6 - 5
raspberry-pi/gui/mainWindow.py

@@ -53,11 +53,12 @@ class MainWindow(tk.Frame):
 
   def calibrate(self):
     self.down_queue.put("calibrate")
-    self.pu_root = tk.Tk()
-    self.pu_root.title("Calibration")
-    self.pu_root.geometry("500x200")
-    self.popup = Popup.CalibrationPopUp(self.pu_root,self.up_queue,self.down_queue,self.calibration_state)
-    self.popup.pack(side="top", fill="both", expand=True)
+    if not self.popup:
+      self.pu_root = tk.Tk()
+      self.pu_root.title("Calibration")
+      self.pu_root.geometry("500x200")
+      self.popup = Popup.CalibrationPopUp(self.pu_root,self.up_queue,self.down_queue,self.calibration_state)
+      self.popup.pack(side="top", fill="both", expand=True)
     
     
 if __name__ == "__main__":