Thanks.
I am very puzzled. The code example sent was tested against Win32-GUI-1.03.03
and Perl 5.8.7 under CyCygwinn a Windows XPXPomputer. It didn't work!
After struggling a long, long time I discovered my mistake. The event handlers
need to be put into the global <main> nanamespacen order for
Win32::GUI::Dialog() to find them. Putting the event handlers within a package
(package <name>;) puts the handlers into the <name>
nanamespaceWin32::GUI::Dialog() can't find the event handlers. Any of the below
seem to work:
1. Do not put the event handlers in a package. Reference
to the file, as in 'use <folder>::<file>;' will still
work and looks remarkably like 'use <folder>::<module>;'.
2. ExExplicitlyutting the event handler into the <main>
nanamespaces in:
::<event handler> { <code> }
I put the <event handler> into my 'Win' nanamespacesing 'project Win;',
violating condition 1) above. I can't figure how you got it to work. If you
did, then my reasoning above is incorrect and needs to be changed. Any ideas?
puzzled art
--- Peter EiEisengreinPeter.EiEisengreintatxom> wrote:
> Works fine for me.
>
> Perl v5.8.3
> Win-GUI 0.0.558
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> > Behalf Of
> > Arthur ScSchwarz> > Sent: Monday, August 28, 2006 2:20 PM
> > To: [EMAIL PROTECTED]
> > Subject: [peperlin32-guguisers] Event subroutines not called
> >
> >
> > This is the simplest example of what I can't get to work. I
> > have a menu inside
> > a window and neither the X_Exit_Click nor the
> > ToTopWindowerminate subroutines
> > are called during Win32::GUI::Dialog() processing. I can't
> > figure what I'm
> > doing wrong and it's driving me crazy (short drive if you ask me).
> >
> > art
> >
> > package Win;
> >
> > use Win32::GUI;
> >
> > my $ToTopMenu new Win32::GUI::Menu(
> > "&File" => "X",
> > ">E&xixit => "X_Exit",
> > );
> >
> >
> > my $ToTopWindow new Win32::GUI::Window(
> > -name => 'ToTopWindow
> > -title => 'GUI Editor',
> > -left => 30,
> > -top => 20,
> > -width => 550,
> > -height => 450,
> > -miminwidth => 440,
> > -miminheight => 380,
> > -menu => $ToTopMenu> > );
> >
> > sub ToTopWindowerminate{
> > print "ToTopWindowerminate\n";
> > return -1;
> > } ### ToTopWindowerminate
> >
> > sub X_Exit_Click {
> > print "X_Exit_Click\n";
> > return -1;
> > } ### X_Exit_Click
> >
> > $ToTopWindowShow(); # makes
> > ToTopWindowisible
> > Win32::GUI::Dialog(); # Windows
> > control loop
> >
> >
> > --------------------------------------------------------------
> > -----------
> > Using Tomcat but need to do more? Need to support web
> > services, security?
> > Get stuff done quickly with prprentegrated technology to make
> > your job easier
> > Download IBM WeWebSpherepplication Server v.1.0.1 based on
> > Apache Geronimo
> > hthttp/sesels-us.fafalkaget/seselmcmdnlnkid=120709&bid=263057&
> dadat21642
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> [EMAIL PROTECTED]
> hthttps/lists.sosourceforgeet/lists/lilistinfoeperlin32-guguisers
> hthttp/peperlin32-guguiosourceforgeet/
>
>
>
> __________________________________________________________
> This message was scanned by ATATX> 3:49:14 PM ET - 8/28/2006
>