def __init__(self, parent, title="Wordnet Project", label1=None, label2=None, string='', text=None): Toplevel.__init__(self, parent) self.transient( parent) #is used to associate this window with a parent window self.title(title) self.parent = parent self.result = None self.text = text body = tk.Frame(self) self.initial_focus = self.body(body) self.resizable(False, False) self.update() parentHeight = int(ctypes.windll.user32.GetSystemMetrics(1)) parentWidth = int(ctypes.windll.user32.GetSystemMetrics(0)) myX = int(parentWidth / 2 - self.winfo_width()) myY = int(parentHeight / 2 - self.winfo_height()) self.geometry("+%d+%d" % (myX, myY)) self.writeMessage() self.buttonbox(label1, label2, string) self.grab_set() if not self.initial_focus: self.initial_focus = self self.initial_focus.focus_set() self.wait_window(self)
def Call_Uplink_Analysis(self): self.newWindow = Toplevel(self.master) self.app = Uplink_Analysis(self.newWindow)
def Call_Convert_Table_Auto(self): self.newWindow = Toplevel(self.master) self.app = Convert_Table_Auto(self.newWindow)
def Call_Open_QCAT(self): self.newWindow = Toplevel(self.master) self.app = QCAT_Auto(self.newWindow)
def graphs(): rc.wpm() rc.acc() rc.hits() gd.data() graphs = Toplevel(root) # mit root verbinden graphs.title("Graphs") graphs.iconbitmap(r"C:\Python\Projects\WPMTracker\icons\window_icon.ico") graphs.resizable(False, False) graphs.geometry("+-1910+130") canvas = tk.Canvas(graphs, width=1400, height=980, bg=background) canvas.grid(columnspan=3, rowspan=3) plt.figure plt.style.use("seaborn-deep") wpm_graph = plt.figure(figsize=(12, 3)) wpm_graph.patch.set_facecolor(background) wpmline = FigureCanvasTkAgg(wpm_graph, graphs) wpmline.get_tk_widget().grid(columnspan=2, column=0, row=0, sticky="NW", padx=10, pady=10) plt.plot('xvalues', 'yvalues', color="#2F78BB", linewidth=3, label='WPM Tracker (WPM)', data=gd.dfwpm) plt.xlabel("Nr.") plt.ylabel("WPM") plt.legend(loc='upper left') plt.grid(True) plt.tight_layout() plt.figure plt.style.use("seaborn-deep") wpm_graph = plt.figure(figsize=(12, 3)) wpm_graph.patch.set_facecolor(background) wpmline = FigureCanvasTkAgg(wpm_graph, graphs) wpmline.get_tk_widget().grid(columnspan=2, column=0, row=1, sticky="NW", padx=10, pady=10) plt.plot('xvalues', 'yvalues', color="#2F78BB", linewidth=3, label='WPM Tracker (Accuracy)', data=gd.dfacc) plt.xlabel("Nr.") plt.ylabel("%") plt.legend(loc='upper left') plt.grid(True) plt.tight_layout() plt.figure plt.style.use("seaborn-deep") wpm_graph = plt.figure(figsize=(12, 3)) wpm_graph.patch.set_facecolor(background) wpmline = FigureCanvasTkAgg(wpm_graph, graphs) wpmline.get_tk_widget().grid(columnspan=2, column=0, row=2, sticky="NW", padx=10, pady=10) plt.plot('xvalues', 'yvalues', color="#2F78BB", linewidth=3, label='WPM Tracker (Tastenanschläge)', data=gd.dfhits) plt.xlabel("Nr.") plt.ylabel("Tastenanschläge") plt.legend(loc='upper left') plt.grid(True) plt.tight_layout() # WPM Record (Label) wpmrecord = tk.Label(graphs, text="WPM Record:") wpmrecord.grid(column=2, row=0, sticky="N", pady=100, padx=20) wpmrecord.config(bg=background, font=("Calibri bold", txtfontsize), fg="#1f262e") # WPM Record wpmrecord = tk.Label(graphs, text=str(rc.maxwpm)) wpmrecord.grid(column=2, row=0) wpmrecord.config(bg=background, font=("Calibri bold", txtfontsize), fg="#0A4A1B") # ACC Record (Label) wpmrecord = tk.Label(graphs, text="Acc Record:") wpmrecord.grid(column=2, row=1, sticky="N", pady=100, padx=20) wpmrecord.config(bg=background, font=("Calibri bold", txtfontsize), fg="#1f262e") # ACC Record wpmrecord = tk.Label(graphs, text=str(rc.maxacc) + "%") wpmrecord.grid(column=2, row=1) wpmrecord.config(bg=background, font=("Calibri bold", txtfontsize), fg="#0A4A1B") # Hits Record (Label) wpmrecord = tk.Label(graphs, text="Hits Record:") wpmrecord.grid(column=2, row=2, sticky="N", pady=100, padx=20) wpmrecord.config(bg=background, font=("Calibri bold", txtfontsize), fg="#1f262e") # Hits Record wpmrecord = tk.Label(graphs, text=str(rc.maxhits)) wpmrecord.grid(column=2, row=2) wpmrecord.config(bg=background, font=("Calibri bold", txtfontsize), fg="#0A4A1B")