Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

wxPerl: is AddMany implemented?

by HelenCr (Monk)
on Apr 19, 2013 at 07:03 UTC ( #1029465=perlquestion: print w/replies, xml ) Need Help??
HelenCr has asked for the wisdom of the Perl Monks concerning the following question:

Dear esteemed Perlmonks

Using wxPerl, it is often cumbersome (and repetitive), to have many widgets added to a sizer, each one in its own line.

I have noticed on the Net, the existence of a "convenience method" called: "AddMany" (for example here:

AddMany is a convenience method for adding several items to a sizer at one time.

Is there a wxPerl implementation of this package? When I try to use it, I get:

Can't locate object method "AddMany" via package "Wx::BoxSizer" ... etc...

Many TIA - Helen

Replies are listed 'Best First'.
Re: wxPerl: is AddMany implemented? (check and see with wxperl_usage)
by Anonymous Monk on Apr 19, 2013 at 08:21 UTC
      :) make it work with wxperl-usage :)
      sub Wx::Sizer::AddMany { my ( $self, $flags, @many ) = @_; $self and $flags or Carp::croak "Usage: Wx::Sizer::AddMany( THIS, +optionalArrayrefOfOptions, window, ... )"; if ( 'ARRAY' eq ref $flags ) { @many or Carp::croak "Usage: Wx::Sizer::AddMany( THIS, optiona +lArrayrefOfOptions, window, ... )"; $self->Add( $_, @$flags ) for @many; } else { $self->Add($_) for $flags, @many; } }
        Thanks, AM's, I'll try that.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1029465]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2018-04-26 20:18 GMT
Find Nodes?
    Voting Booth?