g_speran has asked for the wisdom of the Perl Monks concerning the following question:

Hello All,
I have an issue with the Tk user interface on windows. I have supplied a sample code to reproduce the problem.

When you launch the code, the window opens up in normal state. now take you mouse to the task bar of an open application until the "tool tip" displays. The Tk UI all disappeared. But click on a different tab or adjust the slider and the Tk UI reappears.

Second, maximuze the TK UI, again take you mouse to the task bar of an open application until the "tool tip" displays. This time the Tk UI disappeared again EXCEPT for the notebook.
I have been playing with pack and grid. I have tried using all pack, using all grid, and using a combination of both with no luck, so I call upon the experts.
Any help you can offer will greatly be appreciated
use strict; use Tk; use Tk::SplitFrame; use Tk::LabEntry; use Tk::LabFrame; use Tk::ErrorDialog; use Tk::NoteBook; #use Tk::Label; &maingui; sub maingui { my $MainWindow = MainWindow->new(-title=>'Split Window Example'); my $SplitFrame = $MainWindow->SplitFrame ( '-orientation' => 'vertical', '-trimcolor' => '#c7c7c7', '-background' => 'white', '-sliderposition' => 100, '-borderwidth' => 2, '-sliderwidth' => 7, '-relief' => 'sunken', '-height' => 1000, '-width' => 1000, '-padbefore' => 0, '-padafter' => 0 ); # Values shown above are defaults. my $LeftLabel = $SplitFrame->Label ('-text' => 'Left'); my $RightLabel = $SplitFrame->Label ('-text' => 'Right'); $SplitFrame->pack (-expand => 'true', -fill => 'both'); $SplitFrame->configure ('-sliderposition' => 100); ################################################################### +########### ## Right Side of the Split Frame + ## ################################################################### +########### my $nb = $RightLabel->NoteBook()->pack(-expand=>1,-fill=>'both'); my $tab_1 = $nb->add('one', -label => '1.'); my $tab_2= $nb->add('two', -label => '2. '); my $tab_3 = $nb->add('three', -label => '3. '); ################################################################### +########### ## Tab 1 ## ################################################################### +########### my $startday; my $starthour; my $endday; my $endhour; my $chkoptions; my $frm1 = $tab_1->Frame(-relief=>'groove', -label=>'SOme text here', -borderwidth=>2, )->pack(-side=>'top',-anchor=>'nw',-fill=>'both'); my $frm_start = $tab_1->LabFrame(-relief=>'groove', -label=>'question here?', -labelside=>'acrosstop', )->pack(-side=>'top', -anchor=>'nw', -fill=>'both' ); my $label1 = $frm_start -> Label(-text => 'Between ' ) -> pack(-side => 'left' , -pady =>3 ); my $startday_e= $frm_start->LabEntry(-label=>' day(s) ', -labelPack=> [qw/-side right/], -background=> 'white', -textvariable=> \$startday, -width=>10, )->pack(-side=>'left', -pady=>3, ); my $starthour_e= $frm_start->LabEntry(-label=>' hour(s) and ', -labelPack=> [qw/-side right/], -background=> 'white', -textvariable=> \$starthour, -width=>10, )->pack(-side=>'left', -pady=>3, ); MainLoop; }

Replies are listed 'Best First'.
Re: Perl/Tk - UI disappears
by ldln (Pilgrim) on Mar 21, 2008 at 02:38 UTC
    Hi, I can't reproduce what you describe here (xpsp2/perl5.8.8/Tk804.027), but please note that Tk::SplitFrame is from 1999! It seems to perform very sluggishly..I've had problems with modules from this author before (Tk::Columns), so it might be better to just skip using it and go with Tk::Adjuster instead.
Re: Perl/Tk - UI disappears
by halfcountplus (Hermit) on Mar 21, 2008 at 00:03 UTC
    I don't have Tk::SplitFrame installed and i don't have time right now to install it and test your code. Also i'm not an expert. But i do have a few comments:

  • if it starts it is unlikely to be a pack or grid (ie. geometry managment problem).
  • from your description it sounds as if the "tool-tip" is involved and this is a product of what module? Notebook? How much have you used it before? (I haven't used it at all.)
    I do know that when i was trying to perform operations on menu entries independent of activating them (this is when things like "tool tips" sometimes apply; but it sounds like this is not a menu context -- or is it?) I ran across a lot of web records by people regarding the problems with doing this and that there was some consensus about some modules also failing with "tool tips"

    So it may really be a problem in a module that you are kicking yourself over. Or some more knowlegable person may come along. I believe zentara knows a lot of Tk and perhaps uses windows.

    Also: are you sure you have isolated your problem as much as you can before you ask someone to solve it? I don't need a demo of your app on any level...
Re: Perl/Tk - UI disappears
by zentara (Cardinal) on Mar 21, 2008 at 15:26 UTC
    Your program runs fine for me on linux, I see no problems with the tooltips, or the program disappearing. It is most likely a windows problem (which I don't use), or an old version of your perl. Are you using ActiveStatePerl? If so, upgrade to the latest version, and if your problem persists, file a bug report with ActiveState. Possibly, you should look thru their buglist and see if its been reported or solved.

    You could also post this on the newsgroup comp.lang.perl.tk, where more Windows users can test it, and see if it works for them. State what level of Windows you are using, and what version of Perl.


    I'm not really a human, but I play one on earth. Cogito ergo sum a bum