Problems programming with Tkinter

Walter S. Leipold leipoldw at
Sun Jan 2 09:12:58 EST 2005

Svenglenn writes:
> But, i want the program to open a new dialogue when i press 
> the button "Visa ruta" and in that dialogue will be a field 
> where you can enter a value directly in the program, but a 
> can't get it to work because is don't know how i shall do to 
> open a new dialogue window in the program?

For simple data entry (and file choosing, too!), use the built-in Tk
dialogs.  For example:

.    import tkSimpleDialog
.    answer = tkSimpleDialog.askString(
.        "Dialog title",
.        "Prompt",
.        parent=root,
.        initialvalue="Howdy!")
.    if answer is not None:
. something...

-- Walt

More information about the Python-list mailing list