From: Eric W. <scr...@gm...> - 2007-03-06 09:38:48
|
# from Bob Hunter # on Tuesday 06 March 2007 12:44 am: >Can't we >have an easier API for wxPerl? I think we can. I think so too. I believe tkPerl has had a bit more time (8 years?) and maybe a few more developers. If you're impatient, the standard procedure is to send large bundles of money or small bundles of code. Rants don't compile, sorry. >One approach would be to retain the API of tkPerl, That seems very doubtful. Besides being very different, Wx is quite a bit more flexible than Tk. >possibly have a simpler one, and move additional >detail to a separate file, if any are needed, I've toyed with some DWIM stuff in the dotreader repository, but haven't been particularly happy with the loss of control that inevitably leads to. DWIM not always being DWYM, etc. However, I have identified a few areas where I think we could get some shorter code, such as in using the object as the constructor for its child widgets: my $thingy = $self->newThingy(...); vs my $thingy = Wx::Thingy->new($self, -1, ...); Though named (not positional) parameters and *reasonable* defaults would certainly help. There are a few other things and observations, like that Wx->can should mirror the AUTOLOAD, a huge pile of shortcuts, yaml-driven menus, etc. Some of these ideas have been written and some haven't. Nevertheless, the code is all completely visible at svn.dotreader.com. >with no >need to struggle with unintuitive interface builders >and our code, going mad in between. What interface builder are you using for Tk? >Perhaps I will get >used to it, but I cannot believe I have to give up >PERL's philosophy when programming in PERL. Perl's philosophy is that you write Perl. The trouble with wxPerl is that it is very nearly a straight-port of the C++ Wx, which is no small effort, but is bound to be far from a perlish API. So, you can either wrap it and provide some mixins, traits, etc that make it more perlish, or you can try to redo the binding code to handle 20-odd cases of hash values in XS. Keep in mind that you're talking about a redesign of the API. That's no small task and it is not easily done well. --Eric -- Peer's Law: The solution to the problem changes the problem. --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- |