| GTK+ Reference Manual | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> |
#include <gtk/gtk.h> struct GtkListStore; GtkListStore* gtk_list_store_new (void); GtkListStore* gtk_list_store_new_with_types (gint n_columns, ...); void gtk_list_store_set_n_columns (GtkListStore *store, gint n_columns); void gtk_list_store_set_column_type (GtkListStore *store, gint column, GType type); void gtk_list_store_remove (GtkListStore *store, GtkTreeIter *iter); void gtk_list_store_insert (GtkListStore *store, GtkTreeIter *iter, gint position); void gtk_list_store_insert_before (GtkListStore *store, GtkTreeIter *iter, GtkTreeIter *sibling); void gtk_list_store_insert_after (GtkListStore *store, GtkTreeIter *iter, GtkTreeIter *sibling); void gtk_list_store_prepend (GtkListStore *store, GtkTreeIter *iter); void gtk_list_store_append (GtkListStore *store, GtkTreeIter *iter); |
struct GtkListStore
{
GObject parent;
/*< private >*/
gint stamp;
gpointer root;
gpointer tail;
GList *sort_list;
gint n_columns;
gint sort_column_id;
GtkTreeSortOrder order;
GType *column_headers;
gint length;
}; |
GtkListStore* gtk_list_store_new (void); |
Creates a new GtkListStore. A GtkListStore implements the GtkTreeModel interface, and stores a linked list of rows; each row can have any number of columns. Columns are of uniform type, i.e. all cells in a column have the same type such as G_TYPE_STRING or GDK_TYPE_PIXBUF. Use GtkListStore to store data to be displayed in a GtkTreeView.
| Returns : | a new GtkListStore |
GtkListStore* gtk_list_store_new_with_types (gint n_columns, ...); |
Creates a new list store as with gtk_list_store_new(), simultaneously setting up the columns and column types as with gtk_list_store_set_n_columns() and gtk_list_store_set_column_type().
| n_columns : | number of columns in the list store |
| ... : | pairs of column number and GType |
| Returns : | a new GtkListStore |
void gtk_list_store_set_n_columns (GtkListStore *store, gint n_columns); |
Sets the number of columns in the GtkListStore.
| store : | a GtkListStore |
| n_columns : | number of columns |
void gtk_list_store_set_column_type (GtkListStore *store, gint column, GType type); |
Supported types include: G_TYPE_UINT, G_TYPE_INT, G_TYPE_UCHAR, G_TYPE_CHAR, G_TYPE_BOOLEAN, G_TYPE_POINTER, G_TYPE_FLOAT, G_TYPE_DOUBLE, G_TYPE_STRING, G_TYPE_OBJECT, and G_TYPE_BOXED, along with subclasses of those types such as GDK_TYPE_PIXBUF.
| store : | a GtkListStore |
| column : | column number |
| type : | type of the data stored in column |
void gtk_list_store_remove (GtkListStore *store, GtkTreeIter *iter); |
Removes the given row from the list store, emitting the "deleted" signal on GtkTreeModel.
| store : | a GtkListStore |
| iter : | a row in list_store |
void gtk_list_store_insert (GtkListStore *store, GtkTreeIter *iter, gint position); |
Creates a new row at position, initializing iter to point to the new row, and emitting the "inserted" signal from the GtkTreeModel interface.
| store : | a GtkListStore |
| iter : | iterator to initialize with the new row |
| position : | position to insert the new row |
void gtk_list_store_insert_before (GtkListStore *store, GtkTreeIter *iter, GtkTreeIter *sibling); |
Inserts a new row before sibling, initializing iter to point to the new row, and emitting the "inserted" signal from the GtkTreeModel interface.
| store : | a GtkListStore |
| iter : | iterator to initialize with the new row |
| sibling : | an existing row |
void gtk_list_store_insert_after (GtkListStore *store, GtkTreeIter *iter, GtkTreeIter *sibling); |
Inserts a new row after sibling, initializing iter to point to the new row, and emitting the "inserted" signal from the GtkTreeModel interface.
| store : | a GtkListStore |
| iter : | iterator to initialize with the new row |
| sibling : | an existing row |
void gtk_list_store_prepend (GtkListStore *store, GtkTreeIter *iter); |
Prepends a row to store, initializing iter to point to the new row, and emitting the "inserted" signal on the GtkTreeModel interface for the store.
| store : | a GtkListStore |
| iter : | iterator to initialize with new row |
void gtk_list_store_append (GtkListStore *store, GtkTreeIter *iter); |
Appends a row to store, initializing iter to point to the new row, and emitting the "inserted" signal on the GtkTreeModel interface for the store.
| store : | a GtkListStore |
| iter : | iterator to initialize with the new row |