Re: Progress_bar failing to change

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

 



On 12/16/2014 09:12 PM, Ian Chapman wrote:
Spot on Hrvoje, that's my problem, many thanks for the help.  I'll have
to change the way I'm thinking.

The classic hack to update the progress bar without returning to the main loop is by running:

while (gtk_events_pending())
  gtk_main_iteration()

Still, be careful with this code because it can also trigger other queued events, such as user input, in places where you don't expect it.

A better approach is to structure your code so that a long-standing task is done in a separate thread, which uses idle_add to tell the GUI thread to update the progress bar (and anything else that might need updating).

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list




[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux