def get_passwd_ocf(self):
self.passwd_window_ocf = Tkinter.Toplevel(self.frame3)
self.passwd_window_ocf.title('Postgres Auth(System Password)')
x = self.frame3.winfo_rootx()
y = self.frame3.winfo_rooty()
self.passwd_window_ocf.geometry('350x130+%d+%d' % (x+150, y+100))
self.passwd_window_ocf.lift()
self.passwd_window_ocf.columnconfigure(0, weight=1)
self.passwd_window_ocf.columnconfigure(1, weight=1)
self.passwd_window_ocf.columnconfigure(2, weight=1)
self.passwd_window_ocf.columnconfigure(3, weight=2)
self.passwd_window_ocf.columnconfigure(4, weight=2)
self.passwd_window_ocf.columnconfigure(5, weight=1)
self.passwd_window_ocf.rowconfigure(0, weight=1)
self.passwd_window_ocf.rowconfigure(1, weight=2)
self.passwd_window_ocf.rowconfigure(2, weight=2)
self.passwd_window_ocf.rowconfigure(3, weight=2)
self.passwd_window_ocf.rowconfigure(4, weight=1)
self.passwd_window_ocf.resizable(False, False)
reminder = ttk.Label(self.passwd_window_ocf, text='Please input the system password.')
reminder.grid(row=1, column=1, columnspan=4, sticky='w')
self.pswd_ocf = Tkinter.StringVar()
pwentry = Tkinter.Entry(self.passwd_window_ocf, textvariable=self.pswd_ocf, 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_ocf, text='Password:')
pswdlabel.grid(row=2, column=2, sticky='e', padx=10)
confirm_but = ttk.Button(self.passwd_window_ocf, text='Confirm', command=self.pwconfirm_ocf)
confirm_but.grid(row=3, column=4, sticky='w', padx=5)
clear_but = ttk.Button(self.passwd_window_ocf, text='Clear',
command=lambda: pwentry.delete(0, Tkinter.END))
clear_but.grid(row=3, column=3, sticky='e', padx=5)
self.passwd_window_ocf.bind('<Return>', self.shortcut3)
评论列表
文章目录