import tkinter as tk import tkinter.messagebox import time import queue class CalibrationPopUp(tk.Frame): def __init__(self, root, up_queue, down_queue,calibration_state): self.root = root self.calibration_state = calibration_state self.down_queue = down_queue self.up_queue = up_queue tk.Frame.__init__(self, root) self.csString = tk.StringVar() self.instruction_string = tk.StringVar() self.instruction_string.set("start Calibration!") self.csString.set(self.calibration_state.state_clearname()) cs = tk.Label(self,textvariable=self.csString, anchor="c") cs.pack(side="top", fill="both", expand=True) dummy = tk.Label(self,text="dummy im a dummy", anchor="c") dummy.pack(side="top", fill="both", expand=True) instruction = tk.Label(self,textvariable=self.instruction_string, anchor="c") instruction.pack(side="top", fill="both", expand=True) button = tk.Button(self,text="OK", command=self.calibration_state.next_state_gui, anchor="c") button.pack(side="top", fill="both", expand=True) def update(self): self.csString.set(self.calibration_state.state_clearname()) if self.calibration_state.get_state() == self.calibration_state.WAITING_POS_1: self.instruction_string.set("Move gondola to far left corner!") if self.calibration_state.get_state() == self.calibration_state.WAITING_POS_2: self.instruction_string.set("Move gondole to far right corner!")