Re: statusbar update without main_iteration



maillist <maillist sandlus de> writes:

Hello,

I guess I am missing the point on something here:

I want to update the statusbar message (like "heavy computation
started..." and "computation finished") inside a callback function.

However, if I call gtk_main_iteration() to let the update happen, other
signals get processed, too. Possibly, my callback function get's even
called again. Ok, I can implement some kind of locking, but is all that
really necessary just to update/show a simple message?

Do you now of any better ways to handle this?

gdk_window_process_updates (statusbar->window) should work to force
the statusbar to redraw. [GTK+-2.0, GTK+-1.2, you could use gtk_widget_draw()]
If the changes have caused the size to change as well as the contents,
then things might getabit funny.

Note however, that you really do want to be running the main loop
occasionally during a long computation, otherwise your app won't
redraw properly if the user moves another window over your window
or something. If there are controls that should not be accessed
during the computation, you should set them insensitive with
gtk_widget_set_sensitive().

Regards,
                                        Owen



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