FYI - This is tangential, but I have used Dialogblocks to generate C code.
The C code is close enough that I wrote a perl script to to turn it
into a Wxperl . The perl
code is fairly simple to write and you can customize it to generate
Wxperl apps to
suite your own taste (eg automatically generating all the callbacks as
stubs and
putting references to them in a hash is favorite of mine )
Tried WxGlade - its OK, but Julian Smart's Dialogblocks is much more
complete
and intuitive. The extra step to generate the wxperl is good for you
anyway ;-)
We're old timer perltk here, so the next step we've taken is to abstract
the wxperl widgets
into a module so they are all 1 liners with the few parameters that we vary
as args - all the rest is either in the module or a config module of
constants.
Don't even think about sizers anymore.
Beginning to look a lot like perltk isn't it - oops ;-)
wxpanel->new( align => 'v', name => 'topPanel', parent => 'TOP', expand=> 1,
stretch => 0, background => redbuttonLabelColor);
wxpanel->new(align => 'h',name => 'topWellPanel',parent =>'topPanel',expand
=> 1,stretch => 0);
wxlabel->new(name => 'datasourceText',parent => 'topWellPanel',label=>
"Data Source:",style => wxALIGN_RIGHT,width=>100,height=>16);
wxtextctrl->new(name => 'datasourceTextCtrl',parent
=>'topWellPanel',width => 100);
wxcombobox->new(name => 'datasourceComboBox',parent
=>'topWellPanel',choices => \...@functions,style => wxCB_DROPDOWN|wxCB_READONLY,
callback_text => sub {
print $widgets{wxComboBox}{functionComboBox}->GetValue() .
"\n";}
);
wxbutton->new(name => 'dataSourceSelectButton',parent
=>'topWellPanel',label => "Select...");
wxpanel->new(align => 'h',name => 'topWellPanel',parent =>'topPanel',expand
=> 1,stretch => 0);
wxlabel->new(name => 'functionText',parent => 'topWellPanel',label
=>"Function:",width=>100,height=>16);
wxcombobox->new(name => 'functionComboBox',parent
=>'topWellPanel',choices => \...@functions,style => wxCB_DROPDOWN|wxCB_READONLY,
callback_text => sub {
print $widgets{wxComboBox}{functionComboBox}->GetValue() .
"\n";}
);
wxbutton->new(name => 'runButton',parent => 'topWellPanel',label
=>"Run");
If anyone is interested , we'll post the modules in few months once they're
polished.
On 7/15/2010 5:15 AM, Johan Vromans wrote:
herbert breunung<[email protected]> writes:
i think another on is to use
Wx::Event::EVT_BUTTON
Yes, it is very clarifying to use explicit package names,
&Wx::wxSTAY_ON_TOP
advantages: no fuzz with importing or not importing -> portable code
I must object.
What you call 'no fuzz with importing' is, in fact, placing a booby
trap under your code. Calling subroutines with& is explictly advised
against, and with reason.
-- Johan