Tuvas wrote: > I've been trying to build a fairly simple message box in tkinter, that > when a button is pushed, will pop up a box, that has a line of text, an > entry widget, and a button, that when the button is pushed, will return > the value in the line of text. However, while I can read the value of > the button, I want to wait till the button is pushed to return the > value. Any ideas of how I could do this?
The way I do it is to set self.result in the dialog to the return value just before closing and exiting. And then instead of openiug the dialog directly I use a function to pass and sometimes modify the values to the dialog and then return the dialog.result value after it's closed. Something like... def domydialog(*args, **kwds): # # Check and modify args or kwds here if needed. # mydialog(*args, **kwds) return mydialog.result Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list