I don't know how this compares to TK but try this:

use Win32::GUI;

my $dialogbox = new Win32::GUI::DialogBox(
  -name                 => "dialogbox",
  -text                 => "Demo Dialogbox",
  -left                 => 300,
  -top                  => 120,
  -left                 => 120,
  -width                => 300,
  -height               => 150,
  -minwidth             => 300,
  -minheight            => 150,
  -maxwidth             => 300,
  -maxheight            => 150,
  -helpbutton           => 1,
  -menu                 => 0,
  -maximizebox          => 0,
  -minimizebox          => 0,
  -resizable            => 0,
);

$dialogbox->Show();

my $text = $dialogbox->AddTextfield(
  -name         => 'text',
  -text         => 'some text',
  -left         => 10,
  -top          => 25,
  -size         => [150,25],
  -tabstop      => 1,
  -prompt       => 'enter something:',
);
$text->SendMessage(197, 10, 0);  # limit to 10 character input

my $button = $dialogbox->AddButton(
  -name         => 'button',
  -text         => 'demo button',
  -left         => 25,
  -top          => 55,
  -tabstop      => 1,
  -default      => 1,
  -ok           => 1,
);

$text->SetFocus();
Win32::GUI::Dialog;

sub button_Click
{
  $tln       = $text->Caption;
  print "$tln\n";
}

sub dialogbox_Terminate {
  print 'something';
  sleep(5);
  print '2';
  return 0; # usually return -1??
}



Nathaniel G. Bartusiak
TTMS, Keesler AFB


> Hi all, does anyone know how to intercept/disable right upper corner "x"
> closing window in Win32::GUI?  Similar to what TK's
> $top->protocol('WM_DELETE_WINDOW' => sub {});  Please advise.  Thanks.
> _______________________________________________
> ActivePerl mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to