PasswordDialog here is similar to the Pmw widget PromptDialog, but this version includes a field for login ID as well as password.

The following code shows how to draw a PasswordDialog, and execute some command, but it doesn't show how to obtain the actual login and password information.

   1 from Tkinter import *
   2 from bwidget import *
   3 t = Tk()
   4 t.title('password')
   5 def printMe(s):
   6         print s
   7 
   8 b = Button(t, relief=LINK, text="Quit", command=t.destroy)
   9 b.pack()
  10 
  11 p = PasswordDialog(t, type="okcancel", labelwidth=10,
  12                 command=lambda s='have pwd': printMe(s))
  13 t.mainloop()

Screenshot:

bwPassword2.png

tkinter: PasswordDialog (last edited 2010-07-26 11:59:11 by localhost)