Hi,

With Win32::GUI 1.0, modal dialog are more easier to use.
You only need too call DoModal.

Laurent

See Sample below :

use strict;
use Win32::GUI;

my $MainWindow = Win32::GUI::Window->new(
            -text => "Main",
            -name => "MainWindow",
            -pos  => [ 200, 200 ],
            -size => [ 150, 100 ],
        );

$MainWindow->AddButton(
            -name => "OpenModal",
            -pos  => [ 15, 20 ],
            -text => "Open Modal Window",
        );

my $ModalWindow = Win32::GUI::DialogBox->new(
            -text => "Modal",
            -name => "ModalWindow",
            -pos  => [ 220, 220 ],
            -size => [ 150, 100 ],
        );

$ModalWindow->AddButton(
            -name => "CloseModal",
            -pos  => [ 15, 20 ],
            -text => "Close Modal Window",
        );

$MainWindow->Show();
Win32::GUI::Dialog();

sub OpenModal_Click {
  $ModalWindow->DoModal();
}

sub CloseModal_Click { 
  -1;
}


Reply via email to