Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of jjore (6662)

Sunday October 08, 2006
11:59 PM

wxglade - A one way trip?

[ #31258 ]

It looks like wxglade will generate code but without any hooks or ways to extend the generated code without editing it directly. Bummer.

I was really hoping to use a GUI to make my GUI. :-(

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I'm always wary of those plain code generators because they never are round-trip capable, which means that my upfront design would need to be perfect. And if I had a perfect design already, I wouldn't need a graphical tool to create it. bart [perl.org] has a cool idea how to make code generators work across version upgrades, by applying diff against the baseline file and your current code, and then patching your changes into the new version that wxglade or whatever is the code generator du jour outputs. Of course, som

    • The basic idea is, just as in a version control, that the original generated code gets stored as a root version, and then it branches. One branch is the manual edit, by you, the other is the changes induced by editing the GUI and rerunning the code generation. You'd then be able to merge the manual changes back into the freshly generated code, allowing you to modify the GUI using a WYSIWYG visual designer, and still keep any code you attachedto the widgets.

      I can imagine a similar approach being applicable t
      • I'm generally convinced this is a bad idea. Generated code ought not to be edited especially when in this case the odds are pretty high the code is going to get regenerated.
        • Well, yeah... but I'm lazy. I don't want to write code that the computer can generate. Very lazy. That means I want the computer to write not only the core code for me, but also the stubs for the event handlers, which then I just have to fill up with custom code. Just as in VB. Yes, that may mean that the computer may later want to change the file it wrote the stubs to, after the user edited them.

          I can think of 2 obvious ways to do it:
          1. Have it generate a single master program source file, including the event
    • It turns out there's an easy way to use wxglade to generate code and *not* edit it manually afterward. I'll post more on this later.
      • Sooner would be even better than later! :)

        I've got the itch lately to wrap various bits and pieces in a GUI candy shell, and if you have a straight forward way to do this maintainable without hacking Wx directly, I for one would love to hear how it's done.
    • Actually, the creation of accessors from the control names isn't a GUI Loft thing, it's a Win32::GUI thing. At least it was a couple of years ago. Now there's a new way of doing that, but TGL hasn't kept up.

      Re: code generation, there are some thoughts on that in the manual [bahnhof.se].