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

Re: Treeview render new data.



On Friday 25 June 2004 14:58, John Medrano wrote:

> In our application we are using a GtkListStore and
> GtkTreeview to display application data. Once every
> 100ms will execute the following code:
>
> model = gtk_tree_view_get_model(tableValues);
> g_object_ref(model);
> gtk_tree_view_set_model(tableValues, NULL);
> gtk_list_store_clear(listValues);
> .. append and set values in list store ..
> gtk_tree_view_set_model(tableValues, model);
> g_object_unref(model);

why do you detach and then re-attach the model to the view every 100ms, 
instead of just clearing/manipulating/appending the data in the store 
directly?

> When we run the application, the updated values in the
> list store will not be rendered to the tree without a
> mouse event.  In other words, if you move the mouse
> over the treeview window, the values will be updated.
>
> Is there a simple way to trigger the treeview to
> render new data in the list store?  

Call gtk_tree_model_row_changed() for each row for which you want to force a 
redraw (gtk_list_store_set() will do that automatically for you).

If that doesn't work, you are probably using the treeview in fixed height mode 
and ran into http://bugzilla.gnome.org/show_bug.cgi?id=136496

Cheers
 -Tim


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