~ubuntu-branches/ubuntu/natty/perl-tk/natty

« back to all changes in this revision

Viewing changes to demos/demos/widtrib/balloon.pl

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Zander
  • Date: 2004-03-14 13:54:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314135444-prc09u2or4dbr3to
Tags: 1:800.025-2
Add xlibs-dev to Build-Depends:,
Closes: #237942

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 
55
55
END
56
56
 
57
 
my $c1 = $top->Canvas(-height => 100, -width => 300, -bg => 'white')->pack(-padx => 8, -pady => 8);
58
 
my $c2 = $top->Canvas(-height => 100, -width => 300, -bg => 'white')->pack(-padx => 8, -pady => 8);
 
57
my $clbf = $top->Frame->pack;
 
58
my $cf   = $clbf->Frame->pack(-side => "left");
 
59
 
 
60
my $c1 = $cf->Canvas(-height => 100, -width => 300, -bg => 'white')->pack(-padx => 8, -pady => 8);
 
61
my $c2 = $cf->Canvas(-height => 100, -width => 300, -bg => 'white')->pack(-padx => 8, -pady => 8);
59
62
my $id = $c1->create('text', 10, 10,
60
63
                     -anchor => 'nw',
61
64
                     -text => "This is a canvas.  You can also attach\nballoons to specific items in a canvas");
69
72
            -anchor => 'nw',
70
73
            -text => "Or you can attach the balloon\nto the canvas as a whole.");
71
74
 
 
75
my $lb = $clbf->Listbox->pack(-side => "left");
 
76
$lb->insert(qw/end one two three four/);
 
77
 
72
78
# create the balloon widget
73
79
my $b = $top->Balloon(-statusbar => $status);
74
80
 
143
149
           -msg => 'This balloon is attached to the canvas itself.',
144
150
          );
145
151
 
 
152
$b->attach($lb,
 
153
           -balloonposition => 'mouse',
 
154
           -msg => [qw/1 2 3 4/],
 
155
          );
 
156
 
146
157
# destroy the balloons when I am destroyed:
147
158
#  - Balloon.pm adds bindings to all widgets which we now want to remove if we can.
148
159
$top->OnDestroy(sub { $b->destroy; });