![]() | ![]() | ![]() | exo Reference Manual | ![]() |
---|
ExoIconViewExoIconView — A widget which displays a list of icons in a grid |
#include <exo/exo.h> ExoIconView; GtkWidget* exo_icon_view_new (void); GtkWidget* exo_icon_view_new_with_model (GtkTreeModel *model); GtkTreeModel* exo_icon_view_get_model (ExoIconView *icon_view); void exo_icon_view_set_model (ExoIconView *icon_view, GtkTreeModel *model); gint exo_icon_view_get_text_column (ExoIconView *icon_view); void exo_icon_view_set_text_column (ExoIconView *icon_view, gint column); gint exo_icon_view_get_markup_column (ExoIconView *icon_view); void exo_icon_view_set_markup_column (ExoIconView *icon_view, gint column); gint exo_icon_view_get_pixbuf_column (ExoIconView *icon_view); void exo_icon_view_set_pixbuf_column (ExoIconView *icon_view, gint column); GtkOrientation exo_icon_view_get_orientation (ExoIconView *icon_view); void exo_icon_view_set_orientation (ExoIconView *icon_view, GtkOrientation orientation); GtkSelectionMode exo_icon_view_get_selection_mode (ExoIconView *icon_view); void exo_icon_view_set_selection_mode (ExoIconView *icon_view, GtkSelectionMode mode); GtkTreePath* exo_icon_view_get_path_at_pos (ExoIconView *icon_view, gint x, gint y); void (*ExoIconViewForeachFunc) (ExoIconView *icon_view, GtkTreePath *path, gpointer data); void exo_icon_view_selected_foreach (ExoIconView *icon_view, ExoIconViewForeachFunc func, gpointer data); void exo_icon_view_select_path (ExoIconView *icon_view, GtkTreePath *path); void exo_icon_view_unselect_path (ExoIconView *icon_view, GtkTreePath *path); gboolean exo_icon_view_path_is_selected (ExoIconView *icon_view, GtkTreePath *path); GList* exo_icon_view_get_selected_items (ExoIconView *icon_view); void exo_icon_view_select_all (ExoIconView *icon_view); void exo_icon_view_unselect_all (ExoIconView *icon_view); void exo_icon_view_item_activated (ExoIconView *icon_view, GtkTreePath *path);
"markup-column" gint : Read / Write "model" GtkTreeModel : Read / Write "orientation" GtkOrientation : Read / Write "pixbuf-column" gint : Read / Write "selection-mode" GtkSelectionMode : Read / Write "text-column" gint : Read / Write
"activate-cursor-item" gboolean user_function (ExoIconView *exoiconview, gpointer user_data); "item-activated" void user_function (ExoIconView *exoiconview, GtkTreePath *arg1, gpointer user_data); "move-cursor" gboolean user_function (ExoIconView *exoiconview, GtkMovementStep arg1, gint arg2, gpointer user_data); "select-all" void user_function (ExoIconView *exoiconview, gpointer user_data); "select-cursor-item" void user_function (ExoIconView *exoiconview, gpointer user_data); "selection-changed" void user_function (ExoIconView *exoiconview, gpointer user_data); "set-scroll-adjustments" void user_function (ExoIconView *exoiconview, GtkAdjustment *arg1, GtkAdjustment *arg2, gpointer user_data); "toggle-cursor-item" void user_function (ExoIconView *exoiconview, gpointer user_data); "unselect-all" void user_function (ExoIconView *exoiconview, gpointer user_data);
ExoIconView provides an alternative view on a list model.
It displays the model as a grid of icons with labels. Like
GtkTreeView, it allows to select one or multiple items
(depending on the selection mode, see exo_icon_view_set_selection_mode()
).
In addition to selection with the arrow keys, ExoIconView supports
rubberband selection, which is controlled by dragging the pointer.
typedef struct _ExoIconView ExoIconView;
The ExoIconView struct contains only private fields and should not be directly accessed.
GtkWidget* exo_icon_view_new (void);
Creates a new ExoIconView widget
Returns : | A newly created ExoIconView widget |
GtkWidget* exo_icon_view_new_with_model (GtkTreeModel *model);
Creates a new ExoIconView widget with the model model
.
model : | The model. |
Returns : | A newly created ExoIconView widget. |
GtkTreeModel* exo_icon_view_get_model (ExoIconView *icon_view);
Returns the model the ExoIconView is based on. Returns NULL
if the
model is unset.
icon_view : | a ExoIconView |
Returns : | A GtkTreeModel, or NULL if none is currently being used.
|
void exo_icon_view_set_model (ExoIconView *icon_view, GtkTreeModel *model);
Sets the model for a ExoIconView.
If the icon_view
already has a model set, it will remove
it before setting the new model. If model
is NULL
, then
it will unset the old model.
icon_view : | A ExoIconView. |
model : | The model. |
gint exo_icon_view_get_text_column (ExoIconView *icon_view);
Returns the column with text for icon_view
.
icon_view : | A ExoIconView. |
Returns : | the text column, or -1 if it's unset. |
void exo_icon_view_set_text_column (ExoIconView *icon_view, gint column);
Sets the column with text for icon_view
to be column
. The text
column must be of type G_TYPE_STRING.
icon_view : | A ExoIconView. |
column : | A column in the currently used model. |
gint exo_icon_view_get_markup_column (ExoIconView *icon_view);
Returns the column with markup text for icon_view
.
icon_view : | A ExoIconView. |
Returns : | the markup column, or -1 if it's unset. |
void exo_icon_view_set_markup_column (ExoIconView *icon_view, gint column);
Sets the column with markup information for icon_view
to be
column
. The markup column must be of type G_TYPE_STRING.
If the markup column is set to something, it overrides
the text column set by exo_icon_view_set_text_column()
.
icon_view : | A ExoIconView. |
column : | A column in the currently used model. |
gint exo_icon_view_get_pixbuf_column (ExoIconView *icon_view);
Returns the column with pixbufs for icon_view
.
icon_view : | A ExoIconView. |
Returns : | the pixbuf column, or -1 if it's unset. |
void exo_icon_view_set_pixbuf_column (ExoIconView *icon_view, gint column);
Sets the column with pixbufs for icon_view
to be column
. The pixbuf
column must be of type GDK_TYPE_PIXBUF
icon_view : | A ExoIconView. |
column : | A column in the currently used model. |
GtkOrientation exo_icon_view_get_orientation (ExoIconView *icon_view);
Returns the value of the ::orientation property which determines whether the labels are drawn beside the icons instead of below.
icon_view : | a ExoIconView |
Returns : | the relative position of texts and icons |
void exo_icon_view_set_orientation (ExoIconView *icon_view, GtkOrientation orientation);
Sets the ::orientation property which determines whether the labels are drawn beside the icons instead of below.
icon_view : | a ExoIconView |
orientation : | the relative position of texts and icons |
GtkSelectionMode exo_icon_view_get_selection_mode (ExoIconView *icon_view);
Gets the selection mode of the icon_view
.
icon_view : | A ExoIconView. |
Returns : | the current selection mode |
void exo_icon_view_set_selection_mode (ExoIconView *icon_view, GtkSelectionMode mode);
Sets the selection mode of the icon_view
.
icon_view : | A ExoIconView. |
mode : | The selection mode |
GtkTreePath* exo_icon_view_get_path_at_pos (ExoIconView *icon_view, gint x, gint y);
Finds the path at the point (x
, y
), relative to widget coordinates.
icon_view : | A ExoIconView. |
x : | The x position to be identified |
y : | The y position to be identified |
Returns : | The GtkTreePath corresponding to the icon or NULL
if no icon exists at that position.
|
void (*ExoIconViewForeachFunc) (ExoIconView *icon_view, GtkTreePath *path, gpointer data);
icon_view : | |
path : | |
data : |
void exo_icon_view_selected_foreach (ExoIconView *icon_view, ExoIconViewForeachFunc func, gpointer data);
Calls a function for each selected icon. Note that the model or selection cannot be modified from within this function.
icon_view : | A ExoIconView. |
func : | The funcion to call for each selected icon. |
data : | User data to pass to the function. |
void exo_icon_view_select_path (ExoIconView *icon_view, GtkTreePath *path);
Selects the row at path
.
icon_view : | A ExoIconView. |
path : | The GtkTreePath to be selected. |
void exo_icon_view_unselect_path (ExoIconView *icon_view, GtkTreePath *path);
Unselects the row at path
.
icon_view : | A ExoIconView. |
path : | The GtkTreePath to be unselected. |
gboolean exo_icon_view_path_is_selected (ExoIconView *icon_view, GtkTreePath *path);
Returns TRUE
if the icon pointed to by path
is currently
selected. If icon
does not point to a valid location, FALSE
is returned.
icon_view : | A ExoIconView. |
path : | A GtkTreePath to check selection on. |
Returns : | TRUE if path is selected.
|
GList* exo_icon_view_get_selected_items (ExoIconView *icon_view);
Creates a list of paths of all selected items. Additionally, if you are
planning on modifying the model after calling this function, you may
want to convert the returned list into a list of GtkTreeRowReferences.
To do this, you can use gtk_tree_row_reference_new()
.
To free the return value, use:
g_list_foreach (list, gtk_tree_path_free, NULL); g_list_free (list);
icon_view : | A ExoIconView. |
Returns : | A GList containing a GtkTreePath for each selected row. |
void exo_icon_view_select_all (ExoIconView *icon_view);
Selects all the icons. icon_view
must has its selection mode set
to GTK_SELECTION_MULTIPLE.
icon_view : | A ExoIconView. |
void exo_icon_view_unselect_all (ExoIconView *icon_view);
Unselects all the icons.
icon_view : | A ExoIconView. |
void exo_icon_view_item_activated (ExoIconView *icon_view, GtkTreePath *path);
Activates the item determined by path
.
icon_view : | A ExoIconView |
path : | The GtkTreePath to be activated |
markup-column
" property"markup-column" gint : Read / Write
The ::markup-column property contains the number of the model column containing markup information to be displayed. The markup column must be of type G_TYPE_STRING. If this property and the :text-column property are both set to column numbers, it overrides the text column. If both are set to -1, no texts are displayed.
Allowed values: >= -1
Default value: -1
orientation
" property"orientation" GtkOrientation : Read / Write
How the text and icon of each item are positioned relative to each other.
Default value: GTK_ORIENTATION_VERTICAL
pixbuf-column
" property"pixbuf-column" gint : Read / Write
The ::pixbuf-column property contains the number of the model column containing the pixbufs which are displayed. The pixbuf column must be of type GDK_TYPE_PIXBUF. Setting this property to -1 turns off the display of pixbufs.
Allowed values: >= -1
Default value: -1
selection-mode
" property"selection-mode" GtkSelectionMode : Read / Write
The ::selection-mode property specifies the selection mode of icon view. If the mode is GTK_SELECTION_MULTIPLE, rubberband selection is enabled, for the other modes, only keyboard selection is possible.
Default value: GTK_SELECTION_SINGLE
text-column
" property"text-column" gint : Read / Write
The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type G_TYPE_STRING. If this property and the :markup-column property are both set to -1, no texts are displayed.
Allowed values: >= -1
Default value: -1
selection-box-alpha
" style property"selection-box-alpha" guchar : Read
Opacity of the selection box.
Default value: 64
gboolean user_function (ExoIconView *exoiconview, gpointer user_data);
exoiconview : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
Returns : |
void user_function (ExoIconView *exoiconview, GtkTreePath *arg1, gpointer user_data);
exoiconview : | the object which received the signal. |
arg1 : | |
user_data : | user data set when the signal handler was connected. |
gboolean user_function (ExoIconView *exoiconview, GtkMovementStep arg1, gint arg2, gpointer user_data);
exoiconview : | the object which received the signal. |
arg1 : | |
arg2 : | |
user_data : | user data set when the signal handler was connected. |
Returns : |
void user_function (ExoIconView *exoiconview, gpointer user_data);
exoiconview : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
void user_function (ExoIconView *exoiconview, gpointer user_data);
exoiconview : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
void user_function (ExoIconView *exoiconview, gpointer user_data);
exoiconview : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
void user_function (ExoIconView *exoiconview, GtkAdjustment *arg1, GtkAdjustment *arg2, gpointer user_data);
exoiconview : | the object which received the signal. |
arg1 : | |
arg2 : | |
user_data : | user data set when the signal handler was connected. |
void user_function (ExoIconView *exoiconview, gpointer user_data);
exoiconview : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
void user_function (ExoIconView *exoiconview, gpointer user_data);
exoiconview : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
<< ExoIconBar | Part IV. Extensions to existing frameworks >> |