Hello,
Use Glib threads. Doc is at http://developer.gnome.org/doc/API/2.0/glib/glib-threads.html
When you update data in a thread, you have to lock GTK using gdk_threads_enter ()/gdk_threads_leave().
gdk_threads_enter ();
update data displayed on your widget
gdk_threads_leave ();
See the program example in the FAQ at http://www.gtk.org/faq/#AEN462
Isabelle
-----Message d'origine-----
De : G Hasse [mailto:gh raditex se]
Envoyé : vendredi 12 avril 2002 10:12
À : zhang li
Cc : gtk-app-devel-list gnome org
Objet : Re: gtk_thread stuff
On Thu, 11 Apr 2002, zhang li wrote:
> hi,
>
> does somebody have experience to use gtk_thread stuff?
> I have a main thread in which gtk_main() is called to
> deal with user event, such as button clicking. Now I
> wanna create another gtk thread which is used
> specifically to display some animation. How to do
> that?
You could add a time out function
gtk_timeout_add( 50 , (GtkFunction)Repaint, &RepaintInfo );
to do that.
Göran
>
> Thanks.
>
> sincerely,
> li
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
----------------------------------------------------------------
Göran Hasse email: gh raditex se Tel: 08-6949270
Raditex AB http://www.raditex.se
Sickla Alle 7, 1tr Mob: 070-5530148
131 34 NACKA, SWEDEN
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list