Display window immediately



I'm using Gtk2::TreeStore to display a fairly large amount of grouped
information in drop down lists.

Because of the amount of information being processed in my
create_model() and add_columns() functions it takes 25-30 secs for the
window to appear. How can I make the window appear immediately (so I can
put a progress bar in the bottom)? The guts of the script are below.

Cheers,


Andrew

my $window = Gtk2::Window->new( 'toplevel' );
$window->set_title( "Another hostfile GUI" );
$window->signal_connect( destroy => sub { Gtk2->main_quit; } );

my $vbox = Gtk2::VBox->new( FALSE, 8 );
$vbox->set_border_width(8);
$window->add($vbox);
$vbox->realize;

$vbox->pack_start(Gtk2::Label->new("Hostfile Editor"), FALSE, FALSE, 0);

my $sw = Gtk2::ScrolledWindow->new(undef, undef);
$sw->set_shadow_type('etched-in');
$sw->set_policy('automatic', 'automatic');
$vbox->pack_start($sw, TRUE, TRUE, 0);

my $model = create_model();

# create tree view
my $treeview = Gtk2::TreeView->new ($model);
$treeview->set_rules_hint(TRUE);
$treeview->get_selection->set_mode('multiple');

add_columns($treeview);

$sw->add($treeview);
$window->set_default_size (800, 600);
$window->show_all;

Gtk2->main;


Lead us not into temptation. Just tell us where it is; we'll find it. --
Sam Levenson.




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