def get_passwd(self):
self.passwd_window = Tkinter.Toplevel(self.frame2)
self.passwd_window.title('Log In')
x = self.frame2.winfo_rootx()
y = self.frame2.winfo_rooty()
self.passwd_window.geometry('350x130+%d+%d' % (x+150, y+100))
self.passwd_window.lift()
self.passwd_window.columnconfigure(0, weight=1)
self.passwd_window.columnconfigure(1, weight=1)
self.passwd_window.columnconfigure(2, weight=1)
self.passwd_window.columnconfigure(3, weight=2)
self.passwd_window.columnconfigure(4, weight=2)
self.passwd_window.columnconfigure(5, weight=1)
self.passwd_window.rowconfigure(0, weight=1)
self.passwd_window.rowconfigure(1, weight=2)
self.passwd_window.rowconfigure(2, weight=2)
self.passwd_window.rowconfigure(3, weight=2)
self.passwd_window.rowconfigure(4, weight=1)
self.passwd_window.resizable(False, False)
reminder = ttk.Label(self.passwd_window, text='Please input the system password.')
reminder.grid(row=1, column=1, columnspan=4, sticky='w')
self.pswd = Tkinter.StringVar()
pwentry = Tkinter.Entry(self.passwd_window, textvariable=self.pswd, width=30)
pwentry.focus_set()
pwentry.grid(row=2, column=3, columnspan=2, sticky='w', padx=10)
pwentry.config(show='*')
pswdlabel = ttk.Label(self.passwd_window, text='Password:')
pswdlabel.grid(row=2, column=2, sticky='e', padx=10)
confirm_but = ttk.Button(self.passwd_window, text='Confirm', command=self.pwconfirm)
confirm_but.grid(row=3, column=4, sticky='w', padx=5)
clear_but = ttk.Button(self.passwd_window, text='Clear',
command=lambda: pwentry.delete(0, Tkinter.END))
clear_but.grid(row=3, column=3, sticky='e', padx=5)
self.passwd_window.bind('<Return>', self.shortcut)
评论列表
文章目录