Re: g_object_set and threads



abel schie wrote:
> >No, you don't call gtk_tree_model_row_changed() from you cell data
> >function,
> >but from you time out function, which updates the list store.  And you
> > call it on the list store.
>
> Ok, I've tried that, but still the treeview doesn't get updated.
> Maybe it has to do with g_object_set which I use to update the cell
> renderer? I don't know how that meganism works exactly, but I suspect
> that function emits some signal to something, and that something then
> redraws its window (part). So could it be that my thread only emits that
> signal, and doesn't do the graphical update? I know, it's some wild gues,
> but since I've tried plenty of other things...

I'm giving up. If you showed the code, then may be I could find the problem, but not this way... By the way, you probably don't need gdk_threads_enter()
and gdk_threads_leave() in time out callbacks.  Those are only needed when
multiple threads use GTK+ GUI, but time out callbacks run in the same thread
as the main event dispatching loop.

That's true, but I did that because I was out of ideas.

As I was stripping the code to give you an working example demonstrating
the problem, I found out what it was. After the treeview was created, I started a seperate time consuming thread only to fill the liststore. In this thread I effectively didn't use gdk_threads_enter(). The problem is solved by entering
the lock, or not doing it in a seperate thread.

It puzles me why this is though. I mean, the problem of not updating the
treeview starts _after_ the thread which initialy fills the store has finished...
Anyway, it works now.

Thanks for your input Paul.





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