Re: [Java-gnome-developer] GtkTreeModel: getting value from java
Brought to you by:
afcowie
|
From: Andrew C. <an...@op...> - 2009-12-23 02:00:30
|
On Mon, 2009-12-21 at 23:33 +0300, Alexey Titov wrote:
> Hello. As I understand, there is no way to get value for GtkTreeModel
> from Java. I have to set all values into TreeStore or ListStore before
TreeStore and ListStore are TreeModels
> use it. Sometimes it rather expensive...
TreeModel is nothing more than what you populate to have things appear
in a TreeView. Don't try to use it as a real data structure. We have the
Java language for that. From the documentation for DataColum:
"Keep in mind that you do not need to store all your application
data in the TreeModel. After all, you already have a perfectly
sound (and infinitely more powerful) means to model and
represent your data: the Java language you're working from in
the first place.
You only need to push data into a TreeModel that will be
directly displayed by a TreeView or that will be used to help
manage that display (such as using a numeric type as an
auxiliary sorting index for textual columns that otherwise
wouldn't order properly).
Quite frequently, however, you will want to take a selection or
activation event from the TreeView and get back to the Java
object that where the displayed data came from in the first
place. This is the role of the other significant column type,
DataColumnReference."
http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/DataColumn.html
AfC
Sydney
|