perl_seeker has asked for the wisdom of the Perl Monks concerning the following question:
The number of strings returned by &suggestcomb and stored in @sugs may be different each time the subroutine is called.my @sugs; @sugs=&suggestcomb($gotfile); #print "@sugs\n"; my $top = new MainWindow; my $lsugs=@sugs; #print"\nThe length of the array:"; #print "\n$lsugs"; $opt1="$sugs[0]"; $opt1='Nil' if !$opt1; #print "\n$opt1"; $opt2="$sugs[1]"; $opt2='Nil' if !$opt2; #print "\n$opt2"; $opt3="$sugs[2]"; $opt3='Nil' if !$opt3; #print "\n$opt3"; $opt4="$sugs[3]"; $opt4='Nil' if !$opt4; #print "\n$opt4"; my $l = $top->Label(-text => "Press right button\nfor popup menu.")->p +ack; my $m = $top->Menu(-tearoff => 0,font => "{arial} 12 {bold}",-menuitem +s => [ [Button => "$opt1", -command => \&replace1], [Button => "$opt2", -command => \&replace2], [Button => "$opt3", -command => \&replace3], [Button => "$opt4", -command => \&replace4], ] ); $top->bind("<Button-3>" => sub { $m->Popup(-popover => "cursor",popanc +hor => 'nw') }); } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk Menu question.
by bbfu (Curate) on Sep 27, 2003 at 02:46 UTC | |
by perl_seeker (Scribe) on Sep 29, 2003 at 08:13 UTC | |
by perl_seeker (Scribe) on Oct 06, 2003 at 08:03 UTC | |
by bbfu (Curate) on Oct 07, 2003 at 12:53 UTC | |
by perl_seeker (Scribe) on Oct 08, 2003 at 06:33 UTC | |
by bbfu (Curate) on Oct 09, 2003 at 21:08 UTC | |
| |
|
Re: Tk Menu question.
by Anonymous Monk on Sep 26, 2003 at 08:23 UTC | |
by perl_seeker (Scribe) on Sep 26, 2003 at 09:47 UTC |