Arthur I Schwarz wrote:
I'm have partitioned my program into modules:
<name>::GUI
The program driver is in <name>:
<name>.anonymous subroutine (the nameless thing at the end)
&StartWindows # &<name>::GUI::StartWindows
and <name>::GUI::StartWindows I do:
$window->show();
Win32::GUI::Dialog();
The window displays correctly.
All the pull down menus display correctly.
Selecting any item in a pull down menu has no effect (the event seems to
be
unhandled).
Selecting the big X in the window causes the window to close and control
to
return to the perl program.
The GUI did work with the same code before partitioning, all code in a
single .pl file.
My suspicion is that you are letting the variable that holds your menu
object go out of scope, but with no code posted it's hard to tell. Try
using 'our $menu = ...' rather than 'my $menu = ...' when you create the
menu object. Letting things go out of scope is very easy to do when you
split code into modules.
I split my code in the same way you do, so I doubt that there is problem
with Win32::GUI::Dialog();
Another alternative might be that if you are using OEM events Win32-GUI
can't see your handlers, as they have do be defined in the main package. For
example, you might have had:
sub Button_Click {};
now it would have to be
sub ::Button_Click {};
Is this a perl implementation of an mph polynomial generator? I've already
re-worked the whole constants support (see the archive for this list a
couple of months back), and it currently uses a perl hash to hold the
constants and do the lookup, but given the potential number of constants in
the windows header files I was thinking of implementing a mph solution (and
have been playing with Taj Khattra's mph-1.2, which I have ported to
compile under MS VC++). A perl implementation that generates the
polynomial values to stick in the C code would be a nice way to solve the
problem that I have been struggling with of how to make a distribution
that others can easily add constants to.
Out of curiosity how much faster is a lookup using the mph-1.2 tool set V
the perl hash? How much smaller is the mph structure V the perl hash
structure?
In terms of distribution, couldn't we assume that anyone wanting to add a
constant would have (or need) the ability to build Win32-GUI from source? In
which case, couldn't the hash be built as part of the build process?
Cheers,
jez.