Hello Monks
Having the following popups in a TK application, is there a way to modify the Label of the pop-up buttons by clicking on my button "Change popup" without having to recreate my popup?
use warnings; use strict; use Tk; my $mw = MainWindow->new; my $text = $mw->Text()->pack; add_edit_popup($mw, $text); my $but = $mw->Button( -text => "Change me", -command => \&push_button, ); $but->pack(); MainLoop; sub add_edit_popup { my ($mw, $obj) = @_; my $menu = $mw->Menu(-tearoff=>0, -menuitems=>[ [command=>"Move col to the right", -command=>[sub {MoveColumn( +'right')}, $obj,]], [command=>"Move col to the left", -command=>[sub {MoveColumn(' +left')}, $obj,]], ]); $obj->menu($menu); $obj->bind('<3>', ['PostPopupMenu', Ev('X'), Ev('Y'), ]); return $obj; } sub push_button{ #change/configure #command=>"Move selected column to the right" #command=>"Move selected column to the left", }
In reply to Tk change pupup label by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |