Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Different behavior for Moo and Moose with Wx?

by stefbv (Curate)
on Jun 07, 2015 at 08:04 UTC ( #1129321=note: print w/replies, xml ) Need Help??


in reply to Re: Different behavior for Moo and Moose with Wx?
in thread Different behavior for Moo and Moose with Wx?

Thanks for the feedback, unfortunately fixing the extended class name does not solve the problem :(

  • Comment on Re^2: Different behavior for Moo and Moose with Wx?

Replies are listed 'Best First'.
Re^3: Different behavior for Moo and Moose with Wx?
by Anonymous Monk on Jun 07, 2015 at 08:16 UTC

    Thanks for the feedback, unfortunately fixing the extended class name does not solve the problem :(

    Well, not surprising, fixing thinkos rarely fixes "bugs" :)

    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

    Quick workaround is

    sub MenuBar::Item::BUILD { my $self = shift; bless $self, __PACKAGE__ ; $self->Append( $self->item_quit ); return $self; }

    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 Re: wxperl-users scalar reference objects?

    As you can see a Wx::Menu isn't a hashref, its a scalar ref

    FWIW, not everything needs to be subclasses, ex wxperl_usage

      Thank you, for the explanations. I'm following the "not everything needs to be subclasses" path.

      P.S.: I didn't really think that changing 'Wx::Menu' to 'Wx::MenuItem' will fix the problem :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1129321]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (14)
As of 2018-12-17 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (73 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!