Re: gtk & threads

> > Is gtk thread safe?
> > I am trying to figure out how to get past gtk's "cant refresh while in a
> > function" problem.
> You need to use callbacks as events happen, rather than sitting in one
> function for a long time waiting for a sequence of events to complete.
	I think that he meant more of the user can't do anything while
you're inside of a function that does a lot of work, not that you can't
get events inside of a function.  I.e. reading a lot of data from a file,
over a network (I know that if you're using your own code that you can use
gdk_input_add, but if you're using a library that's not an option), or say
bumpmapping a picture, or something like that.
	Another option, btw bob, is to insert this code:
while(gtk_events_pending())gtk_main_iteration(); inside of your function
in one of the loops that will execute many times/second.

> There are two valid reasons for using threads, and this isn't one of them.
	What are your two valid reasons for using threads?

"If I had had more time I would have written a shorter letter." - Pascal
Linux Programs:
Linux - Get there. Today.
Evil Overlord Quote of the Day:
12. One of my advisors will be an average five-year-old child. Any flaws 
in my plan that he is able to spot will be corrected before implementation.

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