note
Anonymous Monk
<p><i> Thanks for the feedback, unfortunately fixing the extended class name does not solve the problem :( </i><p> Well, not surprising, fixing thinkos rarely fixes "bugs" :)
<p> Well, it might be considered a bug that Moo isn't as helpful as Moose, Moose actually checks the class is blessed into the right, Moo doesn't
<p> Quick workaround is <c>sub MenuBar::Item::BUILD {
my $self = shift;
bless $self, __PACKAGE__ ;
$self->Append( $self->item_quit );
return $self;
}</c>
<p> Now why doesn't Wx::Menu obey the common rules of subclassing/inheritance, well not all things in wxPerl are mean to be subclasses, and indeed menu/menubar are indeed odd candidates for that ... some of this is explained in [href://http://sourceforge.net/p/wxperl/mailman/message/4902265/|Re: wxperl-users scalar reference objects? ]
<p> As you can see a Wx::Menu isn't a hashref, its a scalar ref <readmore><c>#!/usr/bin/perl --
use Wx qw[ :allclasses ];
{ package MMenu; use base qw/ Wx::Menu /; 1; }
{ package MFrame; use base qw/ Wx::Frame /; 1; }
package main;
print join "\n",
MMenu->new,
MFrame->new,
;;;;;
__END__
Wx::Menu=SCALAR(0x3f9afc)
MFrame=HASH(0x99b30c)</c></readmore>
<p> FWIW, not everything needs to be subclasses, ex [id://1027386|wxperl_usage ]
1129292
1129321
9