Re: GtkTreeModel



On Thu, 26 Jul 2001, Joshua N Pritikin wrote:

Is the new GtkTree stuff in 1.3.6 actually working?  i can't find much documentation.
It seems to be designed to be able to display very large trees, like a file system.
Is any example code available that displays a file system?

While i understand the concept, i don't understand how to create GObject interfaces.
For example, how do i make GTK_TREE_MODEL_GET_IFACE(obj) work?  i've only seen
tutorials for Gtk 1.2.x.
I don't think there are any tutorials for the new GObject stuff. The best 
way is probably to browse around in the glib/gtk+ code. This will be 
better in the future.
 
Is the data of GtkTreeIter model-defined?
Yes.
 
i can't quite get my head around descriptions like this:

  Also, with GtkTreeViewColumn, you can bind a property to a value in a GtkTreeModel.
  For example, you can bind the "text" property on the cell renderer to a string value
  in the model, thus rendering a different string in each row of the GtkTreeView.

Basically, the model contains N columns with data. Then you have a view 
with M columns. Each column has a cell renderer that draws it's cells. You 
can map any of the N model columns to any property on one (or several) 
cell renderers for one of the M view columns.

The example described above could have a model with two columns, column 1 
is a string and column 2 is a color. Then the view could have one column, 
with a cell renderer that has "text" bound to model column 1 and 
"background" bound to model column 2.
 
Huh?  Obviously i can dig through the code, but a working example would be great.

I think there are some examples in the tests/ directory in gtk+.

/ alex







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]