[Tkinter-discuss] how to wait for user input?

stewart at midtoad.homelinux.org stewart at midtoad.homelinux.org
Fri Oct 8 03:09:11 CEST 2004



hi all:

I've got a Tkinter app working. One of its methods opens a Pmw combo-box and
present a list of choices.  I've added buttons to delete choices, select
choices, and create a new choice. It's this latter button that is causing problems. 

When I create a choice, I invoke a method that asks for input on the name of a
choice using an easygui entry field. So far so good.  The next thing is to ask
the user to select one of two possible config setting for her choice; I'm doing
that with a top-level widget that contains a button for each of the two
settings.  The problem I'm having is that my method doesn't appear to stop and
wait for the user to press a button, but intead goes ahead to the next step,
which is to display the chosen config setting (which of course fails, since no
choice has yet been made). 

How do I get the method to stop and wait for the config setting to be made in
the toplevel window?  I think that I need the toplevel button to be modal, so
that as soon as it's drawn, execution stops on my choice-creation method.

If this seems too abstract, I can post a sample app that demonstrates the behaviour.

cheers
Stewart



More information about the Tkinter-discuss mailing list