|
@@ -79,10 +79,17 @@ class MainWindow(tk.Frame):
|
|
|
def calibrate(self):
|
|
|
self.ac_sensor.start_calibration()
|
|
|
if not self.popup or not self.pu_root.winfo_exists():
|
|
|
+ # create new window
|
|
|
self.pu_root = tk.Toplevel(self.root)
|
|
|
self.pu_root.wm_transient(self.root)
|
|
|
self.pu_root.wm_title("Calibration")
|
|
|
- self.pu_root.geometry("500x200")
|
|
|
+
|
|
|
+ # make it centered
|
|
|
+ x = (self.pu_root.winfo_screenwidth() - 500) / 2
|
|
|
+ y = (self.pu_root.winfo_screenheight() - 200) / 2
|
|
|
+ self.pu_root.geometry(f'500x200+{int(x)}+{int(y)}')
|
|
|
+
|
|
|
+ # deactivate mainWindow
|
|
|
self.pu_root.grab_set()
|
|
|
self.popup = CalibrationPopUp(self.pu_root, self.ac_cal_state)
|
|
|
self.popup.pack(side="top", fill="both", expand=True)
|