~ubuntu-branches/ubuntu/dapper/perl-tk/dapper

« back to all changes in this revision

Viewing changes to demos/demos/widget_lib/browseentry.pl

  • Committer: Bazaar Package Importer
  • Author(s): Michael C. Schultheiss
  • Date: 2006-01-16 16:54:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060116165402-1ppygm8hh8ahel2x
Tags: 1:804.027-2
* Incorporate changes from NMU (Thanks to Steve Kowalik.
  Closes: #348086)
* debian/control: Update Standards-Version (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# BrowseEntry, entry with listbox to select list values.
 
2
 
 
3
use Tk::BrowseEntry;
 
4
 
 
5
my $month = "January";
 
6
 
 
7
outer:
 
8
{
 
9
    my $top = MainWindow->new;
 
10
    my $f = $top->Frame;
 
11
    my $c = $f->BrowseEntry(-label => "Month:", -variable => \$month);
 
12
    $c->pack;
 
13
    $c->insert("end", "January");
 
14
    $c->insert("end", "February");
 
15
    $c->insert("end", "March");
 
16
    $c->insert("end", "April");
 
17
    $c->insert("end", "May");
 
18
    $c->insert("end", "June");
 
19
    $c->insert("end", "July");
 
20
    $c->insert("end", "August");
 
21
    $c->insert("end", "September");
 
22
    $c->insert("end", "October");
 
23
    $c->insert("end", "November");
 
24
    $c->insert("end", "December");
 
25
    my $bf = $f->Frame;
 
26
    $bf->Button(-text => "Print value",
 
27
                -command => sub {
 
28
                    print "The month is $month\n";
 
29
                }, -relief => "raised")->pack;
 
30
 
 
31
    $bf->pack;
 
32
    $f->pack;
 
33
    MainLoop;
 
34
}