GdauiTreeStore

GdauiTreeStore — Bridge between a GdaTree and a GtkTreeModel

Synopsis

                    GdauiTreeStore;
GtkTreeModel *      gdaui_tree_store_new                (GdaTree *tree,
                                                         guint n_columns,
                                                         ...);
GtkTreeModel *      gdaui_tree_store_newv               (GdaTree *tree,
                                                         guint n_columns,
                                                         GType *types,
                                                         const gchar **attribute_names);

Object Hierarchy

  GObject
   +----GdauiTreeStore

Implemented Interfaces

GdauiTreeStore implements GtkTreeModel, GtkTreeDragSource and GtkTreeDragDest.

Properties

  "tree"                     GdaTree*              : Read / Write / Construct Only

Signals

  "drag-can-drag"                                  : Run Last
  "drag-can-drop"                                  : Run Last
  "drag-delete"                                    : Run Last
  "drag-drop"                                      : Run Last
  "drag-get"                                       : Run Last

Description

The GdauiTreeStore implements the GtkTreeModel interface required to display data from a GdaTree in a GtkTreeView widget.

Details

GdauiTreeStore

typedef struct _GdauiTreeStore GdauiTreeStore;


gdaui_tree_store_new ()

GtkTreeModel *      gdaui_tree_store_new                (GdaTree *tree,
                                                         guint n_columns,
                                                         ...);

Creates a GtkTreeModel interface with a GdaTree, mapping columns to attributes' values.

As an example, gdaui_tree_store_new (tree, 2, G_TYPE_STRING, "name", G_TYPE_STRING, "schema"); creates a GtkTreeStore with two columns (of type G_TYPE_STRING), one with the values of the "name" attribute, and one with the values of the "schema" attribute.

Note that the GType has to correspond to the type of value associated with the attribute name (no type conversion is done), and a warning will be displayed in case of type mismatch.

tree :

n_columns :

number of columns in the tree store

... :

couples of (GType, attribute name) for each column, from first to last

Returns :

the new object, or NULL if an attribute's name was NULL or an empty string

Since 4.2


gdaui_tree_store_newv ()

GtkTreeModel *      gdaui_tree_store_newv               (GdaTree *tree,
                                                         guint n_columns,
                                                         GType *types,
                                                         const gchar **attribute_names);

Creates a GtkTreeModel interface with a GdaTree, mapping columns to attributes' values. For more information and limitations, see gdaui_tree_store_new().

tree :

n_columns :

number of columns in the tree store

types :

an array of n_columns GType to specify the type of each column

attribute_names :

an array of n_columns strings to specify the attribute name to map each column on

Returns :

the new object, or NULL if an inconsistency exists in the parameters

Since 4.2

Property Details

The "tree" property

  "tree"                     GdaTree*              : Read / Write / Construct Only

Signal Details

The "drag-can-drag" signal

gboolean            user_function                      (GdauiTreeStore *gdauitreestore,
                                                        gchar          *arg1,
                                                        gpointer        user_data)           : Run Last

gdauitreestore :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.

Returns :


The "drag-can-drop" signal

gboolean            user_function                      (GdauiTreeStore *gdauitreestore,
                                                        gchar          *arg1,
                                                        gpointer        arg2,
                                                        gpointer        user_data)           : Run Last

gdauitreestore :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.

Returns :


The "drag-delete" signal

gboolean            user_function                      (GdauiTreeStore *gdauitreestore,
                                                        gchar          *arg1,
                                                        gpointer        user_data)           : Run Last

gdauitreestore :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.

Returns :


The "drag-drop" signal

gboolean            user_function                      (GdauiTreeStore *gdauitreestore,
                                                        gchar          *arg1,
                                                        gpointer        arg2,
                                                        gpointer        user_data)           : Run Last

gdauitreestore :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.

Returns :


The "drag-get" signal

gboolean            user_function                      (GdauiTreeStore *gdauitreestore,
                                                        gchar          *arg1,
                                                        gpointer        arg2,
                                                        gpointer        user_data)           : Run Last

gdauitreestore :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.

Returns :