When you're doing it in perl-gtk it could be something like this:
# ...
my $dialog = new Gtk::Dialog;
$dialog->set_title("About");
$dialog->set_modal($true);
$dialog->set_position('center');
# ... fill dialog window with content
# close button
$button = new Gtk::Button( "OK" );
# the variable(s) after \&close_dialog get passed as args to the sub
$button->signal_connect('clicked', \&close_dialog, $dialog);
# ... show widgets
# the close_dialog subroutine
sub close_dialog {
my ($button,$d) = @_;
$d->destroy();
# such a global var might come in handy for some checks:
$dialog_is_on = 0;
}
Of course the destroy()-Method works for other widgets, too. In your
case it might be a Gtk::window
|