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 TopWindow_Terminate 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 $TopMenu = new Win32::GUI::Menu(
       "&File"                => "X",
       ">E&xit"               => "X_Exit",
  );


my $TopWindow = new Win32::GUI::Window(
        -name         => 'TopWindow',
        -title        => 'GUI Editor',
        -left         => 30,
        -top          => 20,
        -width        => 550,
        -height       => 450,
        -minwidth     => 440,
        -minheight    => 380,
        -menu         => $TopMenu
   );

sub TopWindow_Terminate{
  print "TopWindow_Terminate\n";
  return -1;
}  ### TopWindow_Terminate

sub X_Exit_Click  {
  print "X_Exit_Click\n";
  return -1;
}  ### X_Exit_Click

  $TopWindow->Show();                             # makes TopWindow visible
  Win32::GUI::Dialog();                           # Windows control loop


Reply via email to