Re: g_object_set and threads



abel schie wrote:
> I've made a gtktreeviewcolumn with a custom GtkTreeCellDataFunc,
> called cell_func(). This custom function uses the underlying
> GtkListStore to render the cells: it uses gtk_tree_model_get() to
> fetch some values, and then g_object_set(renderer,...) to update the
> cell renderer.
>
> Now, there are some time out functions running, which update the
> GtkListStore. These functions are all surrounded by
> gdk_threads_enter() and gdk_threads_leave(). However, the treeview
> isn't refreshed automatically. Only when I hover it with the mouse it
> gets really updated. Everytime these timeouts are running, cell_func()
> is actually called.
>
> My question is: how can I force g_object_set() to instantly redraw the
> cell renderer? My first thought was: use gdk_threads_enter() and
> gdk_threads_leave() also within cell_func(). But when I do that, I get
> a lock while constructing the treeview, therefore the app
> hangs. Putting the routine creating the treeview in a separate thread
> as well didn't result in anything good.
>
> Any ideas?

My guess would be gtk_tree_model_row_changed().

But how could I do that? Within a GtkTreeCellDataFunc it's not
possible to find out to which row that cell belongs I think.

Is there a way to force the redraw of the cell renderer?





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