Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: optionmenu configure problem in perl tk

by biohisham (Priest)
on Nov 08, 2010 at 08:30 UTC ( [id://870056]=note: print w/replies, xml ) Need Help??


in reply to optionmenu configure problem in perl tk

It doesn't seem that Optionmenu objects have support for the configure option. running your code while the lines $opt->configure(...) and $opt1->configure(...) are commented out yields the Tk widget.

Check Optionmenu Configuration Options...


Excellence is an Endeavor of Persistence. A Year-Old Monk :D .

Replies are listed 'Best First'.
Re^2: optionmenu configure problem in perl tk
by kcott (Archbishop) on Nov 08, 2010 at 13:21 UTC

    Tk::Optionmenu is derived from Tk::Menubutton and probably has support for configuring most, if not all, of its options.

    The documentation is somewhat brief and possibly ambiguous in terms of making a clear distinction between options of the widget (e.g. $w->configure($option => $val); and options of the menu (e.g. $w->addOptions([@new_options]);).

    Try this example code:

    #!perl use 5.12.0; use warnings; use Tk; use Tk::Optionmenu; my $mw = MainWindow->new(); my $om = $mw->Optionmenu( -options => [qw{Zero One Two Three}], )->pack(); my $state = 0; my @states = qw{normal disabled}; $mw->Button(-text => q{Toggle State}, -command => sub { $state ^= 1; $om->configure(-state => $states[$state]); })->pack(); $mw->Button(-text => q{Exit}, -command => sub { exit })->pack(); MainLoop;

    -- Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://870056]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found