def createFlash(self): ''' Creates the Flash Card Frame ''' cur = self.conn.cursor() cur.execute("SELECT * FROM photos WHERE course=?", (self.name,)) rows = cur.fetchall() cur.close() if rows: # Hide this Frame self.master.withdraw() root = Tk() root.title("{} FlashPhotos".format(self.name)) #Center frame to window. w=2000 h=650 ws = root.winfo_screenwidth() # width of the screen hs = root.winfo_screenheight() x = (ws/2) - (w/2) y = (hs/2) - (h/2) root.geometry("%dx%d+%d+%d" % (w, h, x, y)) app = Flash(master=root, name=self.name) app.mainloop() root.destroy() self.master.deiconify() else: messagebox.showerror("OOPS!","Link your course photos to practice with FlashPhotos!")