Displaying a popup before the main window



Hello,

As my program needs a few seconds to start, I would like to display a popup to tell the user that it's working. Looks pretty simple, but for some reason the popup shows up empty, and I can't figure out what I've done wrong.

I would be grateful for any clue, here's a short example which shows the problem.

#!/usr/bin/perl -w

use strict;
use Gtk2 -init;

my $window = Gtk2::Window->new;
$window->set_title ("My window");

my $popup = Gtk2::MessageDialog->new ($window, 'destroy-with-parent', 'info', 'none', "Please wait for 10 seconds...");
$popup->show;
sleep 10;

my $label = Gtk2::Label->new ("Hello, world!");
$window->add ($label);

$popup->destroy;
$window->show_all;
Gtk2->main;

--
Nicolas



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]