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
Masao Mutoh wrote:
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.
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.
···
On Thu, 19 Aug 2004 09:10:55 +0900 > "Joe Laughlin" <Joseph.V.Laughlin@boeing.com> wrote:
Joe Laughlin wrote:
Masao Mutoh wrote:
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.
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.
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
···
On Thu, 19 Aug 2004 09:10:55 +0900 >> "Joe Laughlin" <Joseph.V.Laughlin@boeing.com> wrote:
Hi,
>> 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.
http://ruby-gnome2.sourceforge.jp seems to be down. 
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.
···
On Fri, 20 Aug 2004 05:55:52 +0900 "Joe Laughlin" <Joseph.V.Laughlin@boeing.com> wrote:
--
.:% Masao Mutoh<mutoh@highway.ne.jp>
Masao Mutoh wrote:
Hi,
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.
http://ruby-gnome2.sourceforge.jp seems to be down. 
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
Thanks for the link, but my problem is not adding new rows to the ListStore,
it's showing the update when the object(s) in the ListStore are updated.
···
On Fri, 20 Aug 2004 05:55:52 +0900 > "Joe Laughlin" <Joseph.V.Laughlin@boeing.com> wrote:
Anyway, try to remove
Gtk::TreeViewColumn#set_cell_data_func once.