[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

gnome2 and Gtk::TreeModel

Aria Stewart

9/8/2003 1:19:00 AM

Is anyone out there using Gtk::TreeModel in a ruby app, and have some
code they'd be willing to share? I can't quite make heads or tails of
the docs, and the default implementation of TreeModel (TreeStore) is too
slow when you have as many thousands of nodes in it as I want to put
there.

Ari
7 Answers

Masao Mutoh

9/8/2003 12:16:00 PM

0

Hi,

On Mon, 8 Sep 2003 10:18:53 +0900
Aredridel <aredridel@nbtsc.org> wrote:

> Is anyone out there using Gtk::TreeModel in a ruby app, and have some
> code they''d be willing to share?

* Samples: gtk/sample/gtk-demo/, gtk/sample/testgtk/, gtk/sample/misc/treeview.rb
* rbbr: http://ruby-gnome2.sourceforge.jp/hik...
* XML Tree Viewer: http://ruby-gnome2.sourceforge.jp/hiki.cgi?XML+T...

> I can''t quite make heads or tails of
> the docs, and the default implementation of TreeModel (TreeStore) is too
> slow when you have as many thousands of nodes in it as I want to put
> there.

If you haven''t use GLib::Object#freeze_notify and GLib::Object#thaw_notify yet,
try them. It may improve the speed.

BTW,
Do you build many thousands of nodes at once?
I think it''s not good idea even if you develop it in C.
If the tree becomes so big, it''s better to load the children
(don''t include Grandchildren) when the parent is expanded.

Or, you can use Thread,
though I don''t like to use Thread for this purpose
because it''ll occupy CPU usage.

--
.:% Masao Mutoh<mutoh@highway.ne.jp>

David Espada

9/8/2003 12:39:00 PM

0

El lunes 08 de septiembre, Masao Mutoh escribi&#243;:
>> I can''t quite make heads or tails of the docs, and the default
>> implementation of TreeModel (TreeStore) is too slow when you have
>> as many thousands of nodes in it as I want to put there.
>
> If you haven''t use GLib::Object#freeze_notify and
> GLib::Object#thaw_notify yet, try them. It may improve the speed.

And where are they used?

I don''t find any docu in Ruby-gnome2 or in Gtk webs... :(

--
David Espada, a.k.a. |)a\/inci

Debian GNU/Linux Sid

Masao Mutoh

9/8/2003 1:21:00 PM

0

Hi,

On Mon, 8 Sep 2003 21:58:19 +0900
David Espada <davinciSINSPAM@escomposlinux.org> wrote:

> >> I can''t quite make heads or tails of the docs, and the default
> >> implementation of TreeModel (TreeStore) is too slow when you have
> >> as many thousands of nodes in it as I want to put there.
> >
> > If you haven''t use GLib::Object#freeze_notify and
> > GLib::Object#thaw_notify yet, try them. It may improve the speed.
>
> And where are they used?

Do you invetigate my recommanded samples?

OK, it''s in rbbr.

--
.:% Masao Mutoh<mutoh@highway.ne.jp>

Aria Stewart

9/9/2003 1:05:00 AM

0

On Mon, 2003-09-08 at 06:16, Masao Mutoh wrote:
> Hi,
>
> On Mon, 8 Sep 2003 10:18:53 +0900
> Aredridel <aredridel@nbtsc.org> wrote:
>
> > Is anyone out there using Gtk::TreeModel in a ruby app, and have some
> > code they''d be willing to share?
>
> * Samples: gtk/sample/gtk-demo/, gtk/sample/testgtk/, gtk/sample/misc/treeview.rb

None use TreeModel -- they all use TreeStore, which won''t work well for
me.

> If you haven''t use GLib::Object#freeze_notify and GLib::Object#thaw_notify yet,
> try them. It may improve the speed.

I will do that.

>
> BTW,
> Do you build many thousands of nodes at once?
> I think it''s not good idea even if you develop it in C.
> If the tree becomes so big, it''s better to load the children
> (don''t include Grandchildren) when the parent is expanded.

Actually, it''s a list interface -- no child nodes at all. I''m going to
be filtering the list as part of the UI, but there are times the whole
list will be loaded.

> Or, you can use Thread,
> though I don''t like to use Thread for this purpose
> because it''ll occupy CPU usage.

That''s something I''ll see when I get there.

Aria Stewart

9/9/2003 5:27:00 AM

0

On Mon, 2003-09-08 at 06:16, Masao Mutoh wrote:
> Hi,
>
> On Mon, 8 Sep 2003 10:18:53 +0900
> Aredridel <aredridel@nbtsc.org> wrote:
>
> > Is anyone out there using Gtk::TreeModel in a ruby app, and have some
> > code they''d be willing to share?
>
> * Samples: gtk/sample/gtk-demo/, gtk/sample/testgtk/, gtk/sample/misc/treeview.rb
> * rbbr: http://ruby-gnome2.sourceforge.jp/hik...
> * XML Tree Viewer: http://ruby-gnome2.sourceforge.jp/hiki.cgi?XML+T...

All of them use TreeStore, not the TreeModel module...

I''m interested in making my own model that uses an SQL backend to
display data very dynamically.

Ari

Aria Stewart

9/9/2003 5:30:00 AM

0

On Mon, 2003-09-08 at 23:27, Aredridel wrote:
> On Mon, 2003-09-08 at 06:16, Masao Mutoh wrote:
> > Hi,
> >
> > On Mon, 8 Sep 2003 10:18:53 +0900
> > Aredridel <aredridel@nbtsc.org> wrote:
> >
> > > Is anyone out there using Gtk::TreeModel in a ruby app, and have some
> > > code they''d be willing to share?
> >
> > * Samples: gtk/sample/gtk-demo/, gtk/sample/testgtk/, gtk/sample/misc/treeview.rb
> > * rbbr: http://ruby-gnome2.sourceforge.jp/hik...
> > * XML Tree Viewer: http://ruby-gnome2.sourceforge.jp/hiki.cgi?XML+T...

As a side note, rbbr is one nice tool, and fast and well-written.
Congratulations!

Anyone doing develoment and having gnome2 available would do well to
install ruby-gnome2 and rbbr.

Ari

David Espada

9/10/2003 10:41:00 AM

0

El lunes 08 de septiembre, Masao Mutoh escribi&#243;:
>> > If you haven''t use GLib::Object#freeze_notify and
>> > GLib::Object#thaw_notify yet, try them. It may improve the speed.
>>
>> And where are they used?
>
> Do you invetigate my recommanded samples?

Yes, all but...

> OK, it''s in rbbr.

...this :(

Sorry. And thanks.

--
David Espada, a.k.a. |)a\/inci

Debian GNU/Linux Sid