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

Re: Treeview render new data.



Hello,

I found a problem with clearing/manipulating/appending
approach for my application.  In my application I have
two threads; gtkmain, and a second thread that updates
tree store every 100ms.  I found that when the second
thread is clearing/manipulating/appending the list
store with high frequency, the treeview (which is
driven by gtkmain) tends to get confused and crash the
application.

I could not find reference to multi-threading in the
documentation, so I assumed that I was using the api
for something it was not designed for.  Detaching the
model before clearing/manipulating/appending helped to
fix the problem that I was having by using two
threads.

I have sinced changed the way I am updating data in
the tree store, that seems to give me best performance
and has passed all my reliability test so far.

1. On initilization, append all the records to the
tree store.  I have a fixed number of row/columns in
my tree view.

2. Every 100ms, manipulate the data in the list store.
 I do not clear, then append new records, but instead
update existing records.

Thanks for the help so far, previous response helped
find the problem.

John

--- Ian Zimmerman <itz buug org> wrote:
> 
> John> In our application we are using a GtkListStore
> and
> John> GtkTreeview to display application data. Once
> every
> John> 100ms will execute the following code:
> John> 
> John> model = gtk_tree_view_get_model(tableValues);
> John> g_object_ref(model);
> John> gtk_tree_view_set_model(tableValues, NULL);
> John> gtk_list_store_clear(listValues);
> John> .. append and set values in list store ..
> John> gtk_tree_view_set_model(tableValues, model);
> John> g_object_unref(model);
> 
> Tim> why do you detach and then re-attach the model
> to the view every
> Tim> 100ms, instead of just
> clearing/manipulating/appending the data in
> Tim> the store directly?
> 
> Because that's what the papa/maman tutorial
> recommends?
> 
> -- 
> "It's not true or not."  A reality show producer
> (real quote)
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list gnome org
>
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail


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