Why doesn't my widget (e.g. progressbar) update? [GTK 2.x]

GTK+ FAQ
<<< Previous | Development with GTK+: general questions | Next >>>

# Why doesn't my widget (e.g. progressbar) update? [GTK 2.x]

You are probably doing all the changes within a function without returning control to `gtk_main()`. This may be the case if you do some lengthy calculation in your code. Most drawing updates are only placed on a queue, which is processed within `gtk_main()`. You can force the drawing queue to be processed using something like:

    while (g_main_context_iteration(NULL, FALSE));

inside you're function that changes the widget.

What the above snippet does is run all pending events and high priority idle functions, then return immediately (the drawing is done in a high priority idle function).

<<< Previous | Home | Next >>>
How do I make my window modal? / How do I make a single window active? | Up | How do I attach data to some GTK+ object/widget? [GTK 2.x]