I thought I'd explore Tkinter a bit more before diving into widget
design. Grayson has some examples on the web, which look like they
could help a bit. He uses Pmw, so I thought I'd just remark out the
import for it. It works pretty well, but puts up a a few probably top
level windows that are blank. How do I get around them, and is there
anything else I should be aware of in this code? It produces a small
dialog for entering a new pwd. # Grayson 5_14.py from Tkinter import * from tkSimpleDialog import Dialog import tkMessageBox #import Pmw class GetPassword(Dialog): def body(self, master): self.title("Enter New Password") Label(master, text='Old Password:').grid(row=0, sticky=W) Label(master, text='New Password:').grid(row=1, sticky=W) Label(master, text='Enter New Password Again:').grid(row=2, sticky=W) self.oldpw = Entry(master, width = 16, show='*') self.newpw1 = Entry(master, width = 16, show='*') self.newpw2 = Entry(master, width = 16, show='*') self.oldpw.grid(row=0, column=1, sticky=W) self.newpw1.grid(row=1, column=1, sticky=W) self.newpw2.grid(row=2, column=1, sticky=W) return self.oldpw def apply(self): opw = self.oldpw.get() npw1 = self.newpw1.get() npw2 = self.newpw2.get() if not npw1 == npw2: tkMessageBox.showerror('Bad Password', 'New Passwords do not match') else: # This is where we would set the new password... pass root = Tk() dialog = GetPassword(root) --
Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time) “Life is one damn thing after another." -- Mark Twain |
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor