RE: [gtk-list] Re: gtk and threads



Thanks Sean and Katre for your replies.  I'll try your suggestions.

Katre, does you code fragment replace gtk_main() or do I need to do other
stuff as well?

KRK

> -----Original Message-----
> From:	katre [SMTP:katre@mousetrap.ml.org]
> Sent:	Wednesday, December 16, 1998 11:48 AM
> To:	gtk-list@redhat.com
> Subject:	[gtk-list] Re: gtk and threads
> 
> > 
> > 
> > Has anyone used gtk clist with threads?
> > 
> > It appears to me that gtk doesn't like to be messed with from two (or
> more
> > threads).
> > 
> 
> While I haven't used clist, I am writing a threaded program which uses
> gtk.
> And you're right, you can't call gtk functions from the other thread.
> What
> I did was to set up queues, protected by mutexes, to send data from oine
> thread to another.  The the gtk thread runs in a loop, first checking the
> queue and taking any appropriate actions, then calling a function like
> 
> while (gtk_events_pending())
>    gtk_main_iteration();
> 
> to update the screen.  This has given me fairly good results, and my
> crashes
> aren't due to this, but to all of my other mistakes.
> 
> katre
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com <
> /dev/null



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