Re: Scrollbar with Optionmenu
- From: "Jack D" <goodcall1@xxxxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 07:44:27 GMT
"Penguin_X" <penguin_x@xxxxxxxxxxxx> wrote in message
news:z38Re.18223$j63.818460@xxxxxxxxxxxxxxxxxxxxxxx
> Hi !
>
> I've a little problem with "Optionmenu" method. You know, when you have
> too much variables, the option bar is too long and you can't see all the
> list. Is there a scrollbar command for this method or something that
> could "split" the list in two or three parts ???
>
Yes. Optionmenu is a derived Menubutton widget which allows direct access to
the menu. You only need to configure a columnbreak attribute at the
appropriate menu entries.
[snip]
use Tk;
use Tk::Optionmenu;
use strict;
my @allminutes = map{sprintf("%2.2d",$_)} (0..59);
my $theminute;
my $mw = tkinit;
my $om = $mw->Optionmenu(
-command=> sub {
print "$theminute \n";
} ,
-textvariable=> \$theminute ,
-options=> [
@allminutes
],
)->pack;
my $menu = $om->menu;
for (my $i=10; $i<60; $i+=10) {
$menu->entryconfigure($i,-columnbreak=>1);
}
MainLoop;
__END__
Jack
.
- Follow-Ups:
- Re: Scrollbar with Optionmenu
- From: Penguin_X
- Re: Scrollbar with Optionmenu
- References:
- Scrollbar with Optionmenu
- From: Penguin_X
- Scrollbar with Optionmenu
- Prev by Date: Re: Toplevel Groups
- Next by Date: Re: Perl Tk script as Windows 2000 service
- Previous by thread: Scrollbar with Optionmenu
- Next by thread: Re: Scrollbar with Optionmenu
- Index(es):