| Exo Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <exo/exo.h>
ExoIconBar;
GtkWidget * exo_icon_bar_new (void);
GtkWidget * exo_icon_bar_new_with_model (GtkTreeModel *model);
GtkTreeModel * exo_icon_bar_get_model (ExoIconBar *icon_bar);
void exo_icon_bar_set_model (ExoIconBar *icon_bar,
GtkTreeModel *model);
gint exo_icon_bar_get_pixbuf_column (ExoIconBar *icon_bar);
void exo_icon_bar_set_pixbuf_column (ExoIconBar *icon_bar,
gint column);
gint exo_icon_bar_get_text_column (ExoIconBar *icon_bar);
void exo_icon_bar_set_text_column (ExoIconBar *icon_bar,
gint column);
GtkOrientation exo_icon_bar_get_orientation (ExoIconBar *icon_bar);
void exo_icon_bar_set_orientation (ExoIconBar *icon_bar,
GtkOrientation orientation);
gint exo_icon_bar_get_active (ExoIconBar *icon_bar);
void exo_icon_bar_set_active (ExoIconBar *icon_bar,
gint idx);
gboolean exo_icon_bar_get_active_iter (ExoIconBar *icon_bar,
GtkTreeIter *iter);
void exo_icon_bar_set_active_iter (ExoIconBar *icon_bar,
GtkTreeIter *iter);
A widget that displays any object that implements the GtkTreeModel interface in an icon bar.
Example 1. Creating a new ExoIconBar with a GtkListStore
enum
{
PIXBUF_COLUMN,
STRING_COLUMN,
N_COLUMNS,
};
{
GtkListStore *store;
GtkWidget *bar;
// make a new list store
store = gtk_list_store_new (N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING);
// fill the store with data
fill_store (store);
// create the icon bar
bar = exo_icon_bar_new_with_model (GTK_TREE_MODEL (store));
exo_icon_bar_set_pixbuf_column (EXO_ICON_BAR (bar), PIXBUF_COLUMN);
exo_icon_bar_set_text_column (EXO_ICON_BAR (bar), TEXT_COLUMN);
gtk_widget_show (bar);
// the icon bar keeps a reference on the store now
g_object_unref (G_OBJECT (store));
// add the bar to your GUI now...
}
typedef struct {
GtkContainer __parent__;
} ExoIconBar;
The ExoIconBar struct contains only private fields and should not be directly accessed.
GtkWidget * exo_icon_bar_new (void);
Creates a new ExoIconBar without model.
Returns : |
a newly allocated ExoIconBar. |
GtkWidget * exo_icon_bar_new_with_model (GtkTreeModel *model);
Creates a new ExoIconBar and associates it with
model.
|
A GtkTreeModel. |
Returns : |
a newly allocated ExoIconBar, which is associated with model.
|
GtkTreeModel * exo_icon_bar_get_model (ExoIconBar *icon_bar);
Returns the model the ExoIconBar is based on. Returns NULL if
the model is unset.
|
A ExoIconBar. |
Returns : |
A GtkTreeModel, or NULL if none is currently being used.
|
void exo_icon_bar_set_model (ExoIconBar *icon_bar,
GtkTreeModel *model);
Sets the model for a ExoIconBar. If the icon_bar already has a model
set, it will remove it before settings the new model. If model is NULL,
then it will unset the old model.
|
A ExoIconBar. |
|
A GtkTreeModel or NULL.
|
gint exo_icon_bar_get_pixbuf_column (ExoIconBar *icon_bar);
Returns the column with pixbufs for icon_bar.
|
An ExoIconBar. |
Returns : |
the pixbuf column, or -1 if it's unset. |
void exo_icon_bar_set_pixbuf_column (ExoIconBar *icon_bar,
gint column);
Sets the column with pixbufs for icon_bar to be column. The pixbuf
column must be of type GDK_TYPE_PIXBUF.
|
An ExoIconBar. |
|
A column in the currently used model. |
gint exo_icon_bar_get_text_column (ExoIconBar *icon_bar);
Returns the column with text for icon_bar.
|
An ExoIconBar. |
Returns : |
the text column, or -1 if it's unset. |
void exo_icon_bar_set_text_column (ExoIconBar *icon_bar,
gint column);
Sets the column with text for icon_bar to be column. The
text column must be of type G_TYPE_STRING.
|
An ExoIconBar. |
|
A column in the currently used model or -1 to
use no text in icon_bar.
|
GtkOrientation exo_icon_bar_get_orientation (ExoIconBar *icon_bar);
Retrieves the current orientation of the toolbar. See
exo_icon_bar_set_orientation().
|
An ExoIconBar. |
Returns : |
The orientation of icon_bar.
|
void exo_icon_bar_set_orientation (ExoIconBar *icon_bar,
GtkOrientation orientation);
Sets whether the icon_bar should appear horizontally
or vertically.
|
An ExoIconBar. |
|
A new GtkOrientation. |
gint exo_icon_bar_get_active (ExoIconBar *icon_bar);
Returns the index of the currently active item, or -1 if there's no active item.
|
An ExoIconBar. |
Returns : |
An integer which is the index of the currently active item, or -1 if there's no active item. |
void exo_icon_bar_set_active (ExoIconBar *icon_bar,
gint idx);
Sets the active item of icon_bar to be the item at idx.
|
An ExoIconBar. |
|
An index in the model passed during construction, or -1 to have no active item. |
gboolean exo_icon_bar_get_active_iter (ExoIconBar *icon_bar,
GtkTreeIter *iter);
Sets iter to point to the current active item, if it exists.
|
An ExoIconBar. |
|
An uninitialized GtkTreeIter. |
Returns : |
TRUE if iter was set.
|
void exo_icon_bar_set_active_iter (ExoIconBar *icon_bar,
GtkTreeIter *iter);
Sets the current active item to be the one referenced by iter. iter
must correspond to a path of depth one.
This can only be called if icon_bar is associated with GtkTreeModel.
|
An ExoIconBar. |
|
The GtkTreeIter. |