Re: Progress bars and syscals



Paolo Costabel wrote:
You need to call

while( g_main_iteration (FALSE));

to update the progress bar. The gtk_progress_bar_set_fraction queues draw requests that are then executed inside gtk main event loop. Be careful that calling g_main_iteration also processes user messages, so if the user clicks on something, the corresponding code will be executed inside the while. This may cause unwanted effects.

You can use:
 gdk_window_process_all_updates ();

To process only expose events.

But it's probably better to use g_main_iteration (FALSE) in
conjunction with:
gdk_window_set_transient_for () & gdk_window_set_modal_hint () to
ensure that your progress bar is always on top and that your parent
window doesn't accept user input during your operation.

Cheers,
                          -Tristan

http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#gdk-window-process-all-updates
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#gdk-window-set-transient-for
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Windows.html#gdk-window-set-modal-hint



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