From: Mattia B. <mat...@li...> - 2007-03-18 11:19:53
|
On Sun, 18 Mar 2007 02:24:07 -0700 Eric Wilhelm <scr...@gm...> wrote: Hi, > I'm still not sure what I'm doing with the declarative syntax, but I'm > currently working on a module that will create constructors with 1-2 > required parameters, followed by key => value pairs. This is just a > dump of the autogenerated pod chunk which will accompany it. > > http://scratchcomputing.com/tmp/WxPerl-foo.html Looks fine to me, and I believe this is a very useful feature (I wanted to do it myself). > Let me know if there's anything glaringly wrong about that chunk of pod. > > At the moment, the only classes that I'm mapping are the ones that match > newFull() in the XS source. The code for this is at: > > http://scratchcomputing.com/svn/WxPerl-Constructors/trunk/build/xs_proto_map WxPerl::TreeCtrl->new( $parent, id => -1, pos => Wx::wxDefaultPosition(), size => Wx::wxDefaultSize(), style => Wx::wxTR_HAS_BUTTONS(), validator => Wx::wxDefaultValidator(), name => treeCtrl, ); There are two things I do not like about this. The first is "WxPerl"; right name, wrong capitalization. But this might be my flawed sense of aesthetics... The second is: I suppose I will need to derive all my classes from WxPerl::*. Wouldn't it be better if Wx::Perl::Constructors added a 'create' or 'make' (or whatever) method to all wxPerl classes? For example: use Wx::Perl::Constructors; Wx::TreeCtrl->create( $parent, id => -1, pos => Wx::wxDefaultPosition(), size => Wx::wxDefaultSize(), style => Wx::wxTR_HAS_BUTTONS(), validator => Wx::wxDefaultValidator(), name => treeCtrl, ); What do you think? Regards Mattia |