Leser: 2
8 Einträge, 1 Seite |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl -w use strict; use Tk; use Tk::BrowseEntry; my $mw = tkinit(); my $frame = $mw->Frame->pack; $b = $frame->BrowseEntry(-label => "Label", -browse2cmd => \&show_index); $b->insert("end", "opt1"); $b->insert("end", "opt2"); $b->insert("end", "opt3"); $b->pack; MainLoop; sub show_index { my $self = shift; print shift; }
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
my ($gr_frame34,$dropdown34,$button34,$label34,$var,$line,$cn,$cn_full,$tmp); sub gruppe_loeschen { $framelist->packForget; unless ($gr_frame34){ # init $gr_frame34 = $main->Frame; $label34 = $gr_frame34->Label(-text => 'Gruppe löschen') ->pack(-side => 'top'); $dropdown34 = $gr_frame34->BrowseEntry(-browse2cmd => \&show_index, -variable => \$var))->pack(-side => 'top'); #$dropdown34=$gr_frame34->Listbox(-height=>40)->pack(-side => 'top'); show_group(); my @group_cn; my @group_all; foreach $line (@main::group) { ($cn_full) = split(",", $line); ($tmp, $cn) =split ("=",$cn_full); push(@group_cn,$cn); push(@group_all,$line); } $dropdown34->insert(0,@group_cn); $button34 = $gr_frame34->Button(-text => 'Gruppe löschen', -command => sub{ print $var; print $main::self;##POBLEME STELLE print $group_all[$main::self]; ##POBLEME STELLE $gr_frame34->packForget; } )->pack(-side => 'bottom'); } $active_frame->packForget if ($active_frame); $gr_frame34 -> pack; $active_frame = $gr_frame34; sub show_index { our $self = shift; print shift; }
1 2 3 4 5 6
sub show_index { my $self = shift; our $index = shift; print $index; } print $main::index;
1 2 3 4 5 6 7 8 9 10
my $last_index; $dropdown34 = $gr_frame34->BrowseEntry(-browse2cmd => show_index(\$last_index), -variable => \$var))->pack; sub show_index { my $self = shift; my $index = shift; $index_ref = shift; $$index_ref = $index; }
8 Einträge, 1 Seite |