props has asked for the wisdom of the Perl Monks concerning the following question:
use warnings; use Tk; my $mw = new MainWindow; $mw->geometry("400x400+200+0"); my $frm_name = $mw-> Frame(-relief=>'groove',-borderwidth=>5, -background=>'black')->pack(-side =>'top', -fill=>'x'); my $expensemb = $frm_name->Menubutton( -tearoff=> 0,-text=>"Eksodo", -menuitems=> [[ 'command' => "supplier 1", -command=> \&addtextfield], [ 'command' => "supplier 2" ], [ 'command' => "supplier 3" ], [ 'command' => "supplier 4" ]])->pack(-side=>'left',-anc +hor=>'nw'); my $costlabel = $frm_name -> Label(-text=>"Timh", -background => 'red') -> pack(-side=>'left', -anchor =>'nw', -padx =>70); my $frm_name2 = $mw -> Frame(-relief=> 'groove',-borderwidth => 5,-ba +ckground => 'black') ->pack(-side => 'top',-fill => 'x'); $expenseentry = $frm_name2->Entry(-width=> 10) -> pack(-side =>'left',-anchor =>'nw'); #sub addtextfield #sub addtextfield { #$val = $$expensemb->configure(-menuitems=> [ 'command' => "" MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk - Menuitems -grab text
by liverpole (Monsignor) on Sep 22, 2007 at 13:51 UTC | |
|
Re: Tk - Menuitems -grab text
by props (Hermit) on Sep 22, 2007 at 17:56 UTC |