----- Original Message ----- From: "Geoff Horsnell" <[EMAIL PROTECTED]> To: "Sisyphus" <[EMAIL PROTECTED]> Sent: Wednesday, December 07, 2005 7:53 AM Subject: RE: Problem (bug?) in Perl/Tk
> Thanks for your comment. I first tried updating the version of Perl to 5.8.7 > to see if that cured the problem. It didn't. So, here is a cut down perl > script that demonstrates the problem. I attach the file. Feel free to submit > it to the user group - I wasn't sure how to link it with my earlier text.... > Best way is to just reply to the list in the same thread and provide the script in the body of the email (not as an attachment). No problem .... this post does it for you :-) If you still don't get help, try the 'ptk' mailing list. (For details, go to http://lists.cpan.org and click on the link to ptk. Search their archive first, as the problem might already have been covered.) Here's the script folks : use Tk; use Tk::Button; use Tk::Canvas; use Tk::DialogBox; use Tk::Tiler; use strict; use warnings; # TEXT: Run this simple program. It creates a window entitled "Tryit". It has one # menu item, entitled "Select". If you left click on "Select", a sub-menu appears # with "Enter". Left click on "Enter" and an Entry sub-window appears,entitled # "Single Entry", with both an entry line, and two buttons, entitled"Accept" # and "Cancel". Selecting the "Cancel" button closes the window. However, selecting # the "Close" button on the title bar should also close the window. It does for # the main window ("tryit"), but NOT for the sub-window ("Single Entry"). # Why is this? $::mWin = MainWindow->new; $::mcanvas = $::mWin->Canvas(-height=>"5.c", -width=> "5.c"); $::mcanvas->pack(-expand => 1, -fill => "both"); $::topl = $::mWin->toplevel; $::menub1 = $::topl->Menu(-type => "menubar"); $::topl->configure(-menu => $::menub1); $::menu1 = $::menub1->cascade(-label => "Select", -underline => 0, -tearoff => 0); $::menu1->pack; $::menu1->command(-label => "Enter", -underline => 0, -command => \&setEnter); $::menu1->pack; &::MainLoop; exit; sub setEnter { my ($dialogb, $t1, $t1a, $t1b, $diagb, $val); $dialogb = $::mWin->DialogBox (-title => "Single Entry", -buttons => ["Accept", "Cancel"]); $t1 = $dialogb->Tiler (-columns => 2, -rows => 1); $t1a = $t1->Message (-justify => "right", -text => "Enter Value", -width => 100); $t1b = $t1->Entry (-textvariable => \$val); $t1b->get; $t1->Manage ($t1a, $t1b); $t1->pack; $diagb = $dialogb->Show; return; } __END__ I can confirm that the behaviour reported happens for me, too. But I don't use Tk and couldn't spot a quick solution. Cheers, Rob _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs