Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks
I'm trying to understand if the folowing is a general issue with the TK Menu, or just a problem I am experiencing. I have a menu with icons: when opening a menu by clicking upon its name, the menu opens fast, but if I move from an opend menu to the next one, just moving the mouse from the first to the second menu, the second menu is displayed quite slowing, building an impage after the other (from the top to the bottom). Here is the script (images must be of course saved locally)
#!perl use strict; use warnings; use utf8; use Tk; use Tk::Menu; use Tk::Photo; use Tk::PNG; my $mw = Tk::MainWindow->new(); my $menuitems = [ [Cascade => "~File", -menuitems => [ [Button => "~Neu", -command => \&new, -image => $mw->Photo(-file => '1.png'), -compound => 'left', ], [Separator => ""], [Button => "~Hilfe", -command => \&open, -image => $mw->Photo(-file => '2.png'), -compound => 'left', ], [Button => "~Schließen", -command => sub{ exit(0); }, -image => $mw->Photo(-file => '3.png'), -compound => 'left', ], ], ], [Cascade => "~Options", -menuitems => [ [Button => "~Neu", -command => \&new, -image => $mw->Photo(-file => '1.png'), -compound => 'left', ], [Separator => ""], [Button => "~Hilfe", -command => \&open, -image => $mw->Photo(-file => '2.png'), -compound => 'left', ], [Button => "~Schließen", -command => sub{ exit(0); }, -image => $mw->Photo(-file => '3.png'), -compound => 'left', ], ], ], ]; my $menu = $mw->Menu(-menuitems => $menuitems); $mw->configure(-menu => $menu); $mw->MainLoop();
Any idea?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: tk menu icons slow
by SuicideJunkie (Vicar) on Nov 19, 2015 at 20:47 UTC | |
Re: tk menu icons slow
by Anonymous Monk on Nov 20, 2015 at 00:49 UTC |