herby1620 has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that the above example when run on WXP hangs at the ->Show() statement. From what I can tell, the execution focus is somewhere else (it goes away from my command window) and it may be displaying something "invisable". Since it isn't displayed, I can't do anything, and it hangs. To exit, I type ^C and the interrupt kills the script. Can this be made to work? I was very able to get the messageBox to function WITHOUT going into 'MainLoop', can I do something similar here???#!/bin/perl -w # Try to get a simple dialog box to work. use Tk; # Bring in the Tk stuff. use Tk::DialogBox; my $mw = MainWindow->new; # Get rid of main window, but keep some of it around. $mw->withdraw(); print "Main window created, withdrawn\n"; my $dialog = $mw->DialogBox (-title => "Please pick one of the three", -buttons => ["One", "Two", "Three"]); my $item = $dialog->Show(); # ??? print "Returned from the show, got $item\n"; # Done
Your wisdom would be quite helpful. Past incantations of wisdom have been MOST helpful!! Thanks!!
Update:
It seems that the dialog box is tightly linked to the parent window. They can't (with the code above) be seperated. Even if I try to 'deiconify' the dialog box, until the main window becomes 'normal' it won't happen! Somehow 'messageBox' is able to disconnect these, but THAT is buried pretty deeply in the Tk library (I tried to look for how without luck). Still looking for "secret sauce".
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl/Tk: Dialog boxes for idiots (me)
by Scott7477 (Chaplain) on May 04, 2006 at 23:11 UTC | |
by herby1620 (Monk) on May 05, 2006 at 00:36 UTC | |
by jdtoronto (Prior) on May 05, 2006 at 02:11 UTC | |
by Scott7477 (Chaplain) on May 05, 2006 at 05:05 UTC | |
by herby1620 (Monk) on May 05, 2006 at 16:30 UTC | |
by jdtoronto (Prior) on May 05, 2006 at 18:19 UTC | |
| |
by jdtoronto (Prior) on May 05, 2006 at 18:37 UTC | |
by runrig (Abbot) on May 05, 2006 at 20:23 UTC | |
| |
Re: Perl/Tk: Dialog boxes for idiots (me)
by ocroquette (Novice) on Feb 19, 2009 at 16:05 UTC |