ariel2 has asked for the wisdom of the Perl Monks concerning the following question:

Monks, I am considering writing a relatively large program using Win32::GUI. I have written several smaller programs using this module, but, for a larger app, the basic event handling procedures could get pretty cluttered. What I would really like to do is to break the code up into modules that create their own windows and handle the appropriate events. I found this discussion on SF, but I am curious if anyone has any other code/ideas.

Also, any thoughts on .gld files vs. windows defined in code would also be appreciated...

thanks,

-ariel

Replies are listed 'Best First'.
Re: Win32::GUI event model
by andyf (Pilgrim) on Jun 23, 2004 at 17:16 UTC
    use Disclaimer qw(IANAGUID, IANAWP); # disclaim gui designer, windows programmer

    The method is sound. But your users wont like it. People don't like the Gimp interface for that reason. I can think of applications I hate for that reason too. Generally everyone accepts and expects one parent application class with a monolithic event loop and child windows. You kill it and all the childeren die. Anything that happens in a sub window propagates up to the main loop. Of course its not the only way to do it, but there's reasons for that consensus. For one you avoid inter-process update hell.
    Andy
Re: Win32::GUI event model
by JamesNC (Chaplain) on Jun 24, 2004 at 21:12 UTC
    I was hard-core Tk fan. But I fooled around with WxPerl and fell in love... I am certain it could easily handle a large project. It is oop oriented. Its widgets are well designed and look great. On Windows, you can use ActiveX controls and embed IE and other goodies right into your app, heavens, I can't say enuf. The only downside is that of getting used to a new way of thinking and you have to dig harder to find answers until a nice book comes along for WxPerl. Using WxPerl, you would create your own classes ( packages ) to handle your GUI.

    The typical WxPerl app requires that you subclass Wx::App with your own OnInit() method. Then it is up to you how you want to organize the GUI ( ie, create Frames in one class, or inline them... although I think this approach is going away in favor of forcing you to subclass everything.

    Here is the link to the Win32 binaries. http://wxPerl.sf.net

    Don't use the Unicode version if you want to use the ActiveX modules on ActiveState 5.8 as they aren't built for the current WxPerl build and don't work. The non-Unicode binaries work like a champ!

    Cheers,
    JamesNC