Subject: | $menubutton->cascade also in the Menubutton wiget |
Hello Vadim,
I saw that you created several Menu-MetaFunctions to the Menubutton widget (e.g. command, checkbox, radiobutton etc.). But the cascade metafunction isn't added which is a little bit confusing.
The following patch makes also $Menubutton->cascade(...) possible as it works in a Menu widget.
Best wishes,
Max
Subject: | Menupatch.diff |
--- ./Tk.pm 2011-02-19 21:13:23.000000000 +0100
+++ ./Tk_MenuButton.pm 2018-06-04 23:00:17.521424375 +0200
@@ -1702,8 +1702,9 @@
# internal sub helper for menu
sub _addcascade {
my $mnu = shift;
- my $mnup = $mnu->path;
my $int = $mnu->interp;
+ $mnu = $int->widget("$mnu.m") if (ref($mnu) eq "Tcl::Tk::Widget::Menubutton");
+ my $mnup = $mnu->path;
my %args = @_;
my $smnu = delete $args{'-menu'};
if (!defined($smnu)) {
@@ -1781,6 +1782,10 @@
my $int = $wid->interp;
$int->call("$wid.m",'add','radiobutton',@_);
},
+ cascade => sub {
+ my $wid = shift;
+ _addcascade($wid, @_);
+ },
separator => sub {
my $wid = shift;
my $int = $wid->interp;