From: Johan V. <jvr...@sq...> - 2007-03-17 11:59:34
|
Eric Wilhelm <scr...@gm...> writes: > Mattia, you deserve many more thank-you's and likely don't hear them > often enough. I second this! > Next, I've heard "I want a good, free GUI rad tool" before, and to > be honest, I have no interest in that sort of thing or that line of > discussion and thus no intention to do anything about it. I think this is an very unfortunate attitude. As many people here know, I'm a fan of wxGlade. wxGlade provides a great help in setting up user interfaces and generates good Perl code. Many of the things that bother you when using wxPerl do not bother me, since they're part of automatically generated code that I don't have to maintain. I even don't care to look at this code except for educational purposes. > A. Too many constants and imports. > [...] Having all of these constants in my namespace bothers me > greatly. This has never bothered me. > B. Long method calls and positional parameters. > [...] it is almost impossible to construct and style a TextCtrl in > 1-2 lines. Take your time, take your space. I don't see any problems with: $self->{tx_log} = Wx::TextCtrl->new ($self, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL); I try to avoid long lines as well, but I don't mind a complex statement to take several lines. > C. Flags > e.g. "wxTE_MULTILINE|wxTE_READONLY|wxTE_DONTWRAP" -- It's a > mouthful, and I typically have to look in the documentation anyway. > With so many options, the business of constructing flags via or'd > constants gets noisy rather quickly. This is one of the areas where wxGlade does a fine job in taking your troubles away. > children( > ctrl custom_bit => 'Thing::Control' => 'argument', 'argument', > ctrl text_ctrl => -TextCtrl => "", I find it hard to see where the ctrl custom_bit arguments end, and the new ctrl starts. Reading the above line I'd expect "ctrl text_ctrl" to be an argument of "ctrl custom_bit". > style(te => 'MULTILINE|READONLY|DONTWRAP'), This is only marginally better than wxTE_MULTILINE|wxTE_READONLY|wxTE_DONTWRAP. > ctrl dismiss_button => -Button => '&Close', > ctrl details_button => -Button => '&Details', You're taking away the possibility to use stock buttons. It would be better to use something like: ctrl dismiss_button => -Button => CLOSE, ctrl details_button => -Button => DETAILS, and leave the rest (standard Ids, labels) to Wx. > layout( > h_split qw(right_window bv_manager note_viewer), > v_split qw(window_1 sidebar right_window 195), > # still working on how this comes together > box->vertical->items(qw(...)), # ? > -BoxSizer => [ > vertical => {'sizer options here?' => 'foo'}, > object_identifier => [@sizer_Add_opts], > ], > ); I'm afraid you either have to leave out many features that probable need to be added in due time anyway, or make it as complex as it currently is when using wxPerl directly. Then again, many, if not all, these worries are taken awy by using wxGlade or similar tools. > # in new() or init() > $self->__create_children; > $self->__do_layout; Why the double underscore? Obfuscation? > Again, this is *preliminary* thinking. You can assist by adding > entropy and/or information. As usual, I appreciate your thinking and braindumps very much. In this particular case I'm afraid you're trying to reinvent a wheel that's already comfortably running for many other wxPerl users. Having said that, there are lots of things that can be improved on wxGlade. -- Johan |