SimpleTree: request for input

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-treeview-renderer-example.
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

On 6/11/06, Martin DeMello [email protected] 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

On 6/12/06, Joe Van D. [email protected] 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