On 21/02/2008, David Christensen <[EMAIL PROTECTED]> wrote: > perl-win32-gui-users: > > I'm a Win32::GUI newbie who went through the tutorials the other night: > > http://perl-win32-gui.sourceforge.net/cgi-bin/docs.cgi?doc=tutorial > > and was shocked to see: > > 1. No "use strict" nor "use warnings".
If you look at the tutorial demo code distributed with Win32::GUI (run win32-gui-demos from a cmd prompt) you'll see that it is all strict and warnings safe. There is a line to be drawn somewhere with respect to clarity of the documentation and 'correctness'. We'll never satify everyone with the style used, and so I have tried to err on the side of keeping the task at hand clear. This is not supposed to be a tutorial in good perl coding style, but a tutorial showing the Win32::GUI concepts. Patches are always welcome if you think you can make things clearer. > 2. The scripts used global variables to pass around references to the > windows, controls, etc.. Again, this is one possible style. Possibly not a good one, but it makes it very clear what is being done. I didn't write the tutorials, but have inherited their maintainance based on the lack of anyone else willing to do it. Again, patches welcome. > 3. There were no sender or eventargs arguments. Before this email I wasn't even aware what these things were. Remember this is Perl, not some MS language, so you shouldn't expect the idioms to be the same. There is more than enough support within Win32::GUI to provide an interface like this if you'd like to invest the time in creating all the necessary objects, but there will be a speed and memory hit from doing so (although it's probably not very significant). I think, more importantly, the procedural interface with the parameters decoded is more familiar to perl programmers. > (Not even a $self arg?) RTFM, I don't see them either. You probably want to read about the differences between the OEM and NEM event models (although there's not much in the docs, the samples provide quite a lot of material, as does searching the list archives). > Am I missing something? I was looking for an OO GUI toolkit in Perl. I > intend to build an application that will feature pop-up forms for > editing objects persisted in a database. My idea is to create a class > and a table for each object type. The class includes a method to create > and display a window for editing that type of object. When the user > needs to create/ edit an object, I create an object, stuff it/ get it > stuffed with data, and/or create/ display the editor window. The user > may have many such windows open at the same time, including multiple > windows from the same class. When the user interacts with the windows > and controls, the event handlers need to be able to find the right > object. Microsoft's "sender" argument solves this need nicely. > Microsoft's "eventargs" argument solves other needs nicely. Does > Win32::GUI have equivalents? Yes, it does. If the other replies have not helped you find the right direction, then please post back and we'll see what we can do to help you - there's nothing very hard if you're familiar with perl (and, in some cases, the Win32 API). Regards, Rob. > > > TIA, > > David > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Perl-Win32-GUI-Users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > -- Please update your address book with my new email address: [EMAIL PROTECTED] ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/