[Glade-users] how to make aprogressbar until the new window is ready?



On Mon, 2007-04-02 at 21:42 +0200, Mariano Perez-Sauquillo Perera wrote:
hi,
i would like to show a progress bar until a new window will be created
but i am coming crazy with the threads, do any of you have done
something similar? could you show me how did you do it? thanks in
advance

Gah, dont need threads please ;-)

Creating a GtkWindow should be an atomic operation and shouldnt take
longer than calling progress_bar_push_progress() a single time, and
as such should not require progress bars at all.

If you have to wait a long time before your window is shown, you
are probably loading/accessing a whole bunch of resources around
the same time as you call gtk_window_new(), sure... you can go
about this in a bunch of ways, maybe and maybe not using threads.

first you should split up each step in your initialization process,
and hopefully have even a name for that step to show in your splash
screen (like "loading icons", "accessing db", "establishing connection
to http://...";, etc etc), each step could optionally be executed by
a worker thread and call g_idle_add() to update the gui with the
relevent progress information.

The root of most peoples problem in this regard is that they want
one big stoooopid function that does everything and just blocks,
sorry not going to happen :)

Cheers,
                      -Tristan







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