Leser: 3
9 Einträge, 1 Seite |
1
2
my $sep_frame = $fenster -> Component('Frame' => 'sep_frame')->pack(-expand => 1, -fill => 'both', -side=>"top");
$sep_frame -> Label(-height=>1)->pack(-anchor => 'w', -side => 'left');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
my $mw = tkinit();
$mw->geometry('200x200');
$mw->update;
for my $x ( 1 .. 50 )
{
my $y = sin($x)*100;
my $x1 = 100;
my $x2 = $x1 + $y;
($x1, $x2) = ($x2, $x1) if $x2 < $x1;
$mw -> draw_hl(
$x1,
$x*4,
$x2-$x1,
'darkblue',
);
$mw -> update;
} # for
MainLoop;
#
# draw an horizontal line using a Frame widget
#
sub Tk::Toplevel::draw_hl {
my( $mw, $x, $y, $w, $c ) = @_;
$mw -> Frame(
-width => $w,
-height => 1,
-bd => 0,
-background => $c,
) -> place(
-x => $x,
-y => $y,
);
} # draw_hl
__END__
9 Einträge, 1 Seite |