regexes has asked for the wisdom of the Perl Monks concerning the following question:
This lists the entries Name1, Name2, and Name3 without any problems. I would like Name1 to be the default value, i.e. if the drop-down box is not utilized. I can't seem to find anything to set the default value in the documentation..#!/usr/bin/perl use strict; use Tk; my @names = ( "Name1", "Name2", "Name3"); my $name; my $main = MainWindow->new(); $main->geometry(qw(250x150)); my $opt_frame = $main->Frame( -relief => 'groove', -background => 'grey', -foreground => 'white', )->pack( '-side' => 'top', -fill => 'both', -expand => 1 ); my $namebox = $opt_frame->BrowseEntry( -label => "Names", -choices => \@names, -variable => \$name, )->pack( -side => 'top', -anchor => 'w' ); MainLoop();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Default entry for Tk::BrowseEntry?
by moritz (Cardinal) on May 13, 2008 at 08:39 UTC | |
by regexes (Hermit) on May 13, 2008 at 08:43 UTC | |
by timesink (Initiate) on May 07, 2009 at 12:22 UTC |