Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I can successfully integrate a Checkbox in my popup menu (see below). It is possible to integrate Radiobuttons too? I am failing in this task.
sub Popup{ my ($mw, $obj) = @_; my $menu = $mw->Menu(-tearoff=>0, -menuitems=>[ [ checkbutton => "My Checkbox", -variable => \$var1, -onvalue => '1', -offvalue => '0', -compound => 'left', -command => [ sub { doSomething($var1) }, $obj ] ], ]); $obj->menu($menu); $obj->bind('<ButtonPress>', ['PostPopupMenu', Ev('X'), Ev('Y'), ]) +; return $obj; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Tk Radiobutton in a popup menu
by choroba (Cardinal) on Mar 14, 2018 at 17:07 UTC | |
|
Re: Perl Tk Radiobutton in a popup menu
by Anonymous Monk on Mar 14, 2018 at 17:07 UTC |