![]() |
![]() |
![]() |
Reference Manual of the tinymail framework | ![]() |
---|---|---|---|---|
#define TNY_TYPE_GTK_ACCOUNT_LIST_MODEL_COLUMN TnyGtkAccountListModel; GType tny_gtk_account_list_model_column_get_type (void); GtkTreeModel* tny_gtk_account_list_model_new (void);
TnyGtkAccountListModel implements GtkBuildable, GtkTreeModel, TnyList, GtkTreeDragSource, GtkTreeDragDest and GtkTreeSortable.
A GtkTreeModel implementation for storing TnyStoreAccount instances.
The implementation inherits the GtkTreeStore, implements GtkTreeModel and TnyList. It can for example be used to display the accounts in a GtkComboBox or GtkTreeView. If, however, you want to show both the account names and the folder names in a tree view style, consider using the TnyGtkAccountTreeModel in stead.
It's very important to unreference the instance you will get when doing something like this:
TnyAccount *account; gtk_tree_model_get (model, &iter, TNY_ACCOUNT_LIST_MODEL_INSTANCE_COLUMN, &account, -1); /* use account */ g_object_unref (G_OBJECT(account));
The column is indeed a G_TYPE_OBJECT column and getting it from the GtkTreeModel will indeed add a reference.
#define TNY_TYPE_GTK_ACCOUNT_LIST_MODEL_COLUMN (tny_gtk_account_list_model_column_get_type())
GType tny_gtk_account_list_model_column_get_type (void);
GType system helper function
Returns : | a GType |
GtkTreeModel* tny_gtk_account_list_model_new (void);
Create a new GtkTreeModel instance suitable for showing a list of accounts. Note that when using gtk_combo_box_set_model or gtk_tree_view_set_model, the view will add its reference to your model instance. If you want the view to become the owner, you must get rid of your initial reference.
GtkTreeModel *model = tny_gtk_account_list_model_new (); GtkTreeView *view = ...; gtk_tree_view_set_model (view, model); g_object_unref (model); // this is probably what you want to do
Returns : | a new GtkTreeModel instance suitable for showing accounts |