Forum: Ruby-Gnome 2 SimpleTree: request for input

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Martin DeMello (Guest)
on 2006-06-11 17:38
(Received via mailing list)
A start at writing a SimpleTree class that holds both a TreeStore and
a TreeView and simplifies a lot of common cases. Also provides direct
access to the store and the view if you want to do something more
complicated. Still needs a lot of work, but I thought I'd get some
reactions and suggestions before anything got too set in stone. Right
now there's barely enough of it to run the example from
http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-tre....
Code attached, but here's the interesting part:

# define the tree
s = Gtk::SimpleTree.new([String, String, Integer],
		   ["First Name", 0],
		   ["Last Name", 1,
		     {:weight => Pango::FontDescription::WEIGHT_BOLD}],
		   ["Age", format_age, {:foreground => "red"}],
		   ["Age", simple_age])

# define the initial data
treedata = [
  ['Maria', 'Incognito'],
  ['Jane', 'Average', 1962,
    ['Janinita', 'Average', 1985]]]

s.import_tree(treedata)
s.sel_mode = :none
window.add(s.view)

window.show_all
Gtk.main

(the additional column with the 'simple_age' proc is to demonstrate a
simplified one-argument callback)

martin
Joe Van D. (Guest)
on 2006-06-12 02:44
(Received via mailing list)
On 6/11/06, Martin DeMello <removed_email_address@domain.invalid> wrote:
> s = Gtk::SimpleTree.new([String, String, Integer],
>     ['Janinita', 'Average', 1985]]]
>
> s.import_tree(treedata)
> s.sel_mode = :none
> window.add(s.view)
>
> window.show_all
> Gtk.main
>
> (the additional column with the 'simple_age' proc is to demonstrate a
> simplified one-argument callback)

Can't say anything about the implementation or design at the moment,
but I really like the idea.  Be great if there was support for sorting
and filtering.

Joe
Martin DeMello (Guest)
on 2006-06-12 14:30
(Received via mailing list)
On 6/12/06, Joe Van D. <removed_email_address@domain.invalid> wrote:
>
> Can't say anything about the implementation or design at the moment,
> but I really like the idea.  Be great if there was support for sorting
> and filtering.

Definitely on the to-do list, particularly filtering.

martin
This topic is locked and can not be replied to.