def initUI(self): self.root.title("BoothTool") self.root.config(menu=Menubar(self.root, self)) self.widget = Frame(self.root) self.widget = titlePage(self.root, self) self.widget.pack(expand=True, fill=BOTH, side=TOP)
def createUser(self, username, password, fname, lname): if self.gui.btd.database.newUser(username, password, fname, lname): popup = Toplevel() popup.title("Account created!") windowWidth = popup.winfo_screenwidth() windowHeight = popup.winfo_screenheight() width = .25 * windowWidth height = .1 * windowHeight x = (windowWidth - width) / 2 y = (windowHeight - height) / 2 popup.geometry("%dx%d+%d+%d" % (width, height, x, y)) popup.update() Label( popup, text="Your new account has been successfully created!").pack() Button(popup, text="Dismiss", command=popup.destroy).pack() self.gui.screenChange(title.titlePage(self.root, self.gui)) else: popup = Toplevel() popup.title("Username Exists!") windowWidth = popup.winfo_screenwidth() windowHeight = popup.winfo_screenheight() width = .25 * windowWidth height = .1 * windowHeight x = (windowWidth - width) / 2 y = (windowHeight - height) / 2 popup.geometry("%dx%d+%d+%d" % (width, height, x, y)) popup.update() Label(popup, text="A user account with that username already exists!" ).pack() Button(popup, text="Dismiss", command=popup.destroy).pack()
def createUser(self, username, password, fname, lname): if self.gui.btd.database.newUser(username, password, fname, lname): popup = Toplevel() popup.title("Account created!") windowWidth = popup.winfo_screenwidth() windowHeight = popup.winfo_screenheight() width = .25 * windowWidth height = .1 * windowHeight x = (windowWidth - width) / 2 y = (windowHeight - height) / 2 popup.geometry("%dx%d+%d+%d" % (width, height, x, y)) popup.update() Label(popup, text="Your new account has been successfully created!").pack() Button(popup, text="Dismiss", command=popup.destroy).pack() self.gui.screenChange(title.titlePage(self.root, self.gui)) else: popup = Toplevel() popup.title("Username Exists!") windowWidth = popup.winfo_screenwidth() windowHeight = popup.winfo_screenheight() width = .25 * windowWidth height = .1 * windowHeight x = (windowWidth - width) / 2 y = (windowHeight - height) / 2 popup.geometry("%dx%d+%d+%d" % (width, height, x, y)) popup.update() Label(popup, text="A user account with that username already exists!").pack() Button(popup, text="Dismiss", command=popup.destroy).pack()