Tk::Optionmenu

Tk::Optionmenu will let the user select one of some predefined options values.
Download

Tk::Optionmenu Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tk team
  • Publisher web site:
  • http://search.cpan.org/~ni-s/Tk-804.027/pod/Adjuster.pod

Tk::Optionmenu Tags


Tk::Optionmenu Description

Tk::Optionmenu will let the user select one of some predefined options values. Tk::Optionmenu will let the user select one of some predefined options values.SYNOPSIS use Optionmenu; $opt = $w->Optionmenu( -options => REFERENCE_to_OPTIONLIST, -command => CALLBACK, -variable => SCALAR_REF, ); $opt->addOptions( OPTIONLIST ); # OPTION LIST is # a) $val1, $val2, $val3,... # b) , , ... ] # c) combination of a) and b), e.g., # val1, , val3, val4, , ...The Optionmenu widget allows the user chose between a given set of options.If the user should be able to change the available option have a look at Tk::BrowseEntry.OPTIONS-options(Re)sets the list of options presented.-commandDefines the callback that is invokes when a new option is selected.-variableReference to a scalar that contains the current value of the selected option.-textvariableReference to a scalar that contains the text label of the current value of the selected option.METHODSaddOptionsAdds OPTION_LIST to the already available options.EXAMPLE use Tk; my $mw = MainWindow->new(); my ($var, $tvar); my $opt = $mw->Optionmenu( -options => , , , ], -command => sub { print "got: ", shift, "n" }, -variable => $var, -textvariable => $tvar )->pack; $opt->addOptions(,,,); my $f = $mw->Frame(-relief=>'groove', -borderwidth => 2)->pack; $f->Label(-textvariable=>$tvar)->pack(-side => 'left'); $f->Label(-text => " -> ")->pack(-side => 'left'); $f->Label(-textvariable=>$var)->pack(-side => 'left'); $mw->Button(-text=>'Exit', -command=>sub{$mw->destroy})->pack; MainLoop; Requirements: · Perl


Tk::Optionmenu Related Software