Gtk::TreeView slow?

J

Joe Laughlin

I'm not sure if I'm asking too much of Gtk::ListView, or if my
implementation is slowing things down...

I have a Gtk::ListStore. The first column in the model is an object that
contains about twenty attributes. I then create a Gtk::TreeView that has
one column per attribute in the object (so, around 20 attributes). I use a
cell data rendering function to connect each treeview column to each
attribute in the object.

Each object in the ListStore is updated with new data every X number of
seconds (five, for example).

It works fine if I have a pretty low amount of objects in the ListStore.
But if I put 400 objects in the ListStore and all are displayed in the
TreeView, when updates are applied to the objects, there's a noticable delay
for when the changes are displayed in the TreeView.

Am I approaching the limits of Ruby/Gtk here, or is something else that I'm
doing probably inefficient? I would greatly appreciate any suggestions
anyone has.

Thanks,
Joe Laughlin
 
M

Masao Mutoh

Hi,

I'm not sure if I'm asking too much of Gtk::ListView, or if my
implementation is slowing things down...

I have a Gtk::ListStore. The first column in the model is an object that
contains about twenty attributes. I then create a Gtk::TreeView that has
one column per attribute in the object (so, around 20 attributes). I use a
cell data rendering function to connect each treeview column to each
attribute in the object.

Each object in the ListStore is updated with new data every X number of
seconds (five, for example).

If "cell data rendering function" means Gtk::TreeViewColumn#set_cell_data_func(),
It is one of slowest method. It's better to avoid to use it.

Or, have you tried GLib::Object#freeze_notify, #thaw_notify?
They may make your application faster.
 
J

Joe Laughlin

Masao said:
Hi,



If "cell data rendering function" means
Gtk::TreeViewColumn#set_cell_data_func(), It is one of
slowest method. It's better to avoid to use it.

Yes, that's the function I'm using. Any ideas on how to avoid using it? Or
is it best not to store an object in each row in the ListStore and instead
store the attributes of the objects in the ListStore.
Or, have you tried GLib::Object#freeze_notify,
#thaw_notify?
They may make your application faster.

I haven't tried that, I will and get back to you.
 
J

Joe Laughlin

Joe said:
Yes, that's the function I'm using. Any ideas on how to
avoid using it? Or is it best not to store an object in
each row in the ListStore and instead store the
attributes of the objects in the ListStore.

I haven't tried that, I will and get back to you.

http://ruby-gnome2.sourceforge.jp seems to be down. :(

Would I call freeze_notify on the ListStore or on the TreeView?

The rows update on time if I'm scrolling through the TreeView at the same
time that the data is updated, but if I'm not scrolling, the data shown is
much behind the updated data. Are there any ways I can fix this?

Thanks,
Joe
 
M

Masao Mutoh

Hi,

Yes, that's the function I'm using. Any ideas on how to avoid using it? Or
is it best not to store an object in each row in the ListStore and instead
store the attributes of the objects in the ListStore.

Usually, you don't need to use the method if you don't use complex column.
I recommand to make your table simple.
 
M

Masao Mutoh

Hi,


Now you can see it, though there is no answer what you want.
Would I call freeze_notify on the ListStore or on the TreeView?

I'm not sure. Try it to both classes.
The rows update on time if I'm scrolling through the TreeView at the same
time that the data is updated, but if I'm not scrolling, the data shown is
much behind the updated data. Are there any ways I can fix this?

Hmm. Did you try google?

I found some informations, for example:
http://www.pygtk.org/pygtk2tutorial/sec-TreeModelInterface.html#sec-LargeDataStores

Anyway, try to remove Gtk::TreeViewColumn#set_cell_data_func once.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top