The New PerlTk.org - Specifying a Default Optionmenu Selection
www.mamboteam.com
The New PerlTk.org  
Home
Wednesday, 16 April 2014
 
 
Main Menu
Home
Perl/Tk Widgets
Articles
Scripts
Useful Tips
Links
Contact Us
Search
FAQs
Login Form
Username

Password

Remember me
Forgotten your password?
No account yet? Create one
Specifying a Default Optionmenu Selection PDF Print E-mail
User Rating: / 27
PoorBest 
Written by Ala Qumsieh   
There are 2 ways to specify a default Optionmenu selection:
  1. 1. Order the array reference that you pass to -options such that the first element is your default one.
  2. 2. Use the undocumented -textvariable option, instead of -variable, and set it to the default value you want:
        my @values = 1 .. 10;
        my $value  = 5;
        my $menu   = $mw->Optionmenu( -options      => \@values,
                                      -textvariable => \$value )->pack();
    

    Comments
    file commands
    Written by newindian on 2006-03-28 01:23:08
    hai i am doing one perl tk programe.i want to set toolbar.can anybody say hoe to create open,save,save as,new,copy,paste etc. 
     
     
    Newindian
    Written by rob on 2006-10-01 10:58:59
    -textvariable was added to the documentation in the Tk804 releases.

    Only registered users can write comments.
    Please login or register.

    Powered by AkoComment 2.0!

< Prev
 
Top! Top!