ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-tk
perl-tk
Re: DialogBox not Being Displayed
by Steve Waltner other posts by this author
Jul 17 2007 8:09AM messages near this date
RE: DialogBox not Being Displayed | State in Button Widget
SOURCE On Jul 16, 2007, at 6:19 PM, Jack D wrote:
> > -----Original Message-----
> > From: ptk-bounces@[...].edu
> > [mailto:ptk-bounces@[...].edu] On Behalf Of Steve Waltner
> > Sent: Monday, July 16, 2007 12:46 PM
> > To: ptk@[...].edu
> > Subject: DialogBox not Being Displayed
> >
> > We've been running ActivePerl 5.8.0 on Windows for some time
> > and recently upgraded to ActivePerl 5.8.8. Along the way (ActivePerl
> > 5.8.4) the Perl Tk module was upgraded to 804.027.
> > Previously, it had been using 800.???. While this fixed the
> > original problem we had, it introduced a problem where the
> > behavior of DialogBox changed and our dialog boxes are no
> > longer being displayed. A code snippet that demonstrates this is:
> >
> > =======
> > use Tk;
> > use Tk::DialogBox;
> >
> > $main = MainWindow->new();    # this creates the main dialog box
> > $dialog = $main->DialogBox (-title => "TITLE BAR TEXT",
> > -buttons => [ "Button 1","Button 2" ] ); # this creates the
> > desired box
> > $main->withdraw();            # this makes the main dialog
> > box invisible
> > $button = $dialog->Show();    # this makes the desired dialog
> > box appear
> > $main->destroy();             # this destroys the main dialog box
> > print "Button pushed: $button\n";
> > =======
> >
> > The problem is that the user wants to hide the main window
> > and still show the DialogBox. With version 4.x of
> > DialogBox.pm, the "withdraw"
> > that hides $main also keeps $dialog from being shown on the screen.
> 
>  This code has introduces a "transient" call likely in order to  
>  avoid having
>  the window get hidden beneath the main window (which was a problem  
>  in 800).
>  Unfortunately this has the side effect as you note here - i.e. If  
>  the main
>  window is withdrawn - so is the dialog.
> 
> >
> > How should one code it where you hide the main Tk window, but
> > are still allowed to show a DialogBox created off the main window?
> 
>  The fix is to add the following line after you create your  
>  DialogBox object.
> 
>  $dialog->transient('');
> 
>  HTH
>  Jack

Thanks Jack. I think that will solve the problem in our code. Adding  
the transient call to this little code snippet I received from the  
developer fixed the issue, so I'm assuming it will solve the issue in  
the actual program. As much as I wanted to blame this on a bug in Tk,  
I was pretty sure it was just a coding error on our part. :-) Thanks  
again for the quick response.

Steve
--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
ptk@[...].edu
https://mailman.stanford.edu/mailman/listinfo/ptk
Thread:
Steve Waltner
Jack D
Steve Waltner
Amit Didwania
Slaven Rezic
Amit Didwania
Amit Didwania

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved