Leser: 13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl use strict; use warnings; use Tk; my $mw = MainWindow -> new (); $mw -> minsize (200, 250); &listbox; $mw -> Button (-text => "Button", -command => \&listbox) -> pack (); MainLoop; sub listbox { my @liste = @_; my $listbox = $mw -> Scrolled ("Listbox") -> place (-x => 0, -y => 35); }
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
#!/usr/bin/perl use strict; use warnings; use Tk; my $mw = MainWindow -> new (); $mw -> minsize (200, 250); &listbox; $mw -> Button (-text => "Button", -command => \&listbox)->pack(); MainLoop; sub listbox{ my @liste = @_; my $listbox = $mw->Scrolled ("Listbox", -scrollbars => 'sw' )->place( -x => 10, -y => 30, -height => 150, # wird benötigt -width => 150 # wird benötigt ); }