You don't need to poll: in your non-GUI thread you can call
g_idle_add, and the callback will be executed by the main GUI thread
'soon'.

Eg.:

  worker_fn() {
    for(;;) {
      void *stuff = g_malloc( .... );

      calculate_stuff( stuff );
      g_idle_add( update_with_stuff, stuff );
    }
  }

Then this will run from the GUI thread and can do any gtk:

  static gboolean update_with_stuff( viud *stuff ) {
    update_gui( stuff );
    g_free( stuff );
  }

I guess you might need something to stop the queue getting too big.

John

On 3/14/07, Luka Napotnik <[EMAIL PROTECTED]> wrote:
> I fixed this issue by making g_timeout() calls to a function that checks
> a queue for requests to change the UI.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to