>     # Begin button row
>     $btn_DBWindowDefault = $DBWindow->AddButton(
>         -name    => 'DBWindowDefault',
>         -text    => 'Ok',
>         -tabstop => 1,
>         -default => 1,                   # Give button darker border
>         -ok      => 1,                   # press 'Return' to click this button
>         -pos => [ 25, $nexthoriz += 25 ],
>         -size => [ 60, 20 ],
>     );
> ...
>     $DBWindowsb = $DBWindow->AddStatusBar();
> ...
>     # Resize, position and display
>     $DBWindow->Resize( $w, $h );
>     $DBWindow->Move( $wx, $wy );
> 
>     $DBWindow->Show();
>     return 0;
> }
> ...
> # What to do when the button is clicked 
> #######################################
> sub DBWindowDefault_Click {
> ...
> return 0;
> }
> 
> I'm just adding "package ldms_core;" at the top and "1;__END__" at the
> bottom. Any ideas?

Hi,

You are using the OEM (Old Event Model) where Win32::GUI assumes the event 
handlers are in the "main" name space. When you add a package to surround your 
code the sub DBWindowDefault_Click is actually ldms_core::DBWindowDefault_Click 
and therefore nothing is called when the event is fired (as Win32::GUI calls 
::DBWindowDefault_Click) . If you want to use packages to encapsulate (which is 
the way to go IMHO) then you really need to use the NEM (New Event Model) where 
you specify a sub reference to the event handle on the creation of the object 
(or add it later). Alternatively, add "::" to the events which force them to be 
in the main name space.

Cheers,

Jeremy.

_________________________________________________________________
Imagine a life without walls.  See the possibilities
http://clk.atdmt.com/UKM/go/122465943/direct/01/
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
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/

Reply via email to