Synopsis
#include <gtk/gtk.h>
GtkIconView;
void (*GtkIconViewForeachFunc) (GtkIconView *icon_view,
GtkTreePath *path,
gpointer data);
GtkWidget* gtk_icon_view_new (void);
GtkWidget* gtk_icon_view_new_with_model (GtkTreeModel *model);
void gtk_icon_view_set_model (GtkIconView *icon_view,
GtkTreeModel *model);
GtkTreeModel* gtk_icon_view_get_model (GtkIconView *icon_view);
void gtk_icon_view_set_text_column (GtkIconView *icon_view,
gint column);
gint gtk_icon_view_get_text_column (GtkIconView *icon_view);
void gtk_icon_view_set_markup_column (GtkIconView *icon_view,
gint column);
gint gtk_icon_view_get_markup_column (GtkIconView *icon_view);
void gtk_icon_view_set_pixbuf_column (GtkIconView *icon_view,
gint column);
gint gtk_icon_view_get_pixbuf_column (GtkIconView *icon_view);
GtkTreePath* gtk_icon_view_get_path_at_pos (GtkIconView *icon_view,
gint x,
gint y);
gboolean gtk_icon_view_get_item_at_pos (GtkIconView *icon_view,
gint x,
gint y,
GtkTreePath **path,
GtkCellRenderer **cell);
void gtk_icon_view_convert_widget_to_bin_window_coords
(GtkIconView *icon_view,
gint wx,
gint wy,
gint *bx,
gint *by);
void gtk_icon_view_set_cursor (GtkIconView *icon_view,
GtkTreePath *path,
GtkCellRenderer *cell,
gboolean start_editing);
gboolean gtk_icon_view_get_cursor (GtkIconView *icon_view,
GtkTreePath **path,
GtkCellRenderer **cell);
void gtk_icon_view_selected_foreach (GtkIconView *icon_view,
GtkIconViewForeachFunc func,
gpointer data);
void gtk_icon_view_set_selection_mode (GtkIconView *icon_view,
GtkSelectionMode mode);
GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView *icon_view);
void gtk_icon_view_set_orientation (GtkIconView *icon_view,
GtkOrientation orientation);
GtkOrientation gtk_icon_view_get_orientation (GtkIconView *icon_view);
void gtk_icon_view_set_columns (GtkIconView *icon_view,
gint columns);
gint gtk_icon_view_get_columns (GtkIconView *icon_view);
void gtk_icon_view_set_item_width (GtkIconView *icon_view,
gint item_width);
gint gtk_icon_view_get_item_width (GtkIconView *icon_view);
void gtk_icon_view_set_spacing (GtkIconView *icon_view,
gint spacing);
gint gtk_icon_view_get_spacing (GtkIconView *icon_view);
void gtk_icon_view_set_row_spacing (GtkIconView *icon_view,
gint row_spacing);
gint gtk_icon_view_get_row_spacing (GtkIconView *icon_view);
void gtk_icon_view_set_column_spacing (GtkIconView *icon_view,
gint column_spacing);
gint gtk_icon_view_get_column_spacing (GtkIconView *icon_view);
void gtk_icon_view_set_margin (GtkIconView *icon_view,
gint margin);
gint gtk_icon_view_get_margin (GtkIconView *icon_view);
void gtk_icon_view_select_path (GtkIconView *icon_view,
GtkTreePath *path);
void gtk_icon_view_unselect_path (GtkIconView *icon_view,
GtkTreePath *path);
gboolean gtk_icon_view_path_is_selected (GtkIconView *icon_view,
GtkTreePath *path);
GList* gtk_icon_view_get_selected_items (GtkIconView *icon_view);
void gtk_icon_view_select_all (GtkIconView *icon_view);
void gtk_icon_view_unselect_all (GtkIconView *icon_view);
void gtk_icon_view_item_activated (GtkIconView *icon_view,
GtkTreePath *path);
void gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
GtkTreePath *path,
gboolean use_align,
gfloat row_align,
gfloat col_align);
gboolean gtk_icon_view_get_visible_range (GtkIconView *icon_view,
GtkTreePath **start_path,
GtkTreePath **end_path);
void gtk_icon_view_set_tooltip_item (GtkIconView *icon_view,
GtkTooltip *tooltip,
GtkTreePath *path);
void gtk_icon_view_set_tooltip_cell (GtkIconView *icon_view,
GtkTooltip *tooltip,
GtkTreePath *path,
GtkCellRenderer *cell);
gboolean gtk_icon_view_get_tooltip_context (GtkIconView *icon_view,
gint *x,
gint *y,
gboolean keyboard_tip,
GtkTreeModel **model,
GtkTreePath **path,
GtkTreeIter *iter);
void gtk_icon_view_set_tooltip_column (GtkIconView *icon_view,
gint column);
gint gtk_icon_view_get_tooltip_column (GtkIconView *icon_view);
enum GtkIconViewDropPosition;
void gtk_icon_view_enable_model_drag_source
(GtkIconView *icon_view,
GdkModifierType start_button_mask,
const GtkTargetEntry *targets,
gint n_targets,
GdkDragAction actions);
void gtk_icon_view_enable_model_drag_dest
(GtkIconView *icon_view,
const GtkTargetEntry *targets,
gint n_targets,
GdkDragAction actions);
void gtk_icon_view_unset_model_drag_source
(GtkIconView *icon_view);
void gtk_icon_view_unset_model_drag_dest (GtkIconView *icon_view);
void gtk_icon_view_set_reorderable (GtkIconView *icon_view,
gboolean reorderable);
gboolean gtk_icon_view_get_reorderable (GtkIconView *icon_view);
void gtk_icon_view_set_drag_dest_item (GtkIconView *icon_view,
GtkTreePath *path,
GtkIconViewDropPosition pos);
void gtk_icon_view_get_drag_dest_item (GtkIconView *icon_view,
GtkTreePath **path,
GtkIconViewDropPosition *pos);
gboolean gtk_icon_view_get_dest_item_at_pos (GtkIconView *icon_view,
gint drag_x,
gint drag_y,
GtkTreePath **path,
GtkIconViewDropPosition *pos);
GdkPixmap* gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
GtkTreePath *path);
Object Hierarchy
GObject
+----GInitiallyUnowned
+----GtkObject
+----GtkWidget
+----GtkContainer
+----GtkIconView
Properties"column-spacing" gint : Read / Write "columns" gint : Read / Write "item-width" gint : Read / Write "margin" gint : Read / Write "markup-column" gint : Read / Write "model" GtkTreeModel* : Read / Write "orientation" GtkOrientation : Read / Write "pixbuf-column" gint : Read / Write "reorderable" gboolean : Read / Write "row-spacing" gint : Read / Write "selection-mode" GtkSelectionMode : Read / Write "spacing" gint : Read / Write "text-column" gint : Read / Write "tooltip-column" gint : Read / Write Signals"activate-cursor-item" : Run Last / Action "item-activated" : Run Last "move-cursor" : Run Last / Action "select-all" : Run Last / Action "select-cursor-item" : Run Last / Action "selection-changed" : Run First "set-scroll-adjustments" : Run Last "toggle-cursor-item" : Run Last / Action "unselect-all" : Run Last / Action Description
GtkIconView 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 DetailsGtkIconViewtypedef struct _GtkIconView GtkIconView; The GtkIconView struct contains only private fields and should not be directly accessed. GtkIconViewForeachFunc ()void (*GtkIconViewForeachFunc) (GtkIconView *icon_view, GtkTreePath *path, gpointer data);
A function used by
gtk_icon_view_new ()GtkWidget* gtk_icon_view_new (void); Creates a new GtkIconView widget
Since 2.6 gtk_icon_view_new_with_model ()GtkWidget* gtk_icon_view_new_with_model (GtkTreeModel *model);
Creates a new GtkIconView widget with the model
Since 2.6 gtk_icon_view_set_model ()void gtk_icon_view_set_model (GtkIconView *icon_view, GtkTreeModel *model);
Sets the model for a GtkIconView.
If the
Since 2.6 gtk_icon_view_get_model ()GtkTreeModel* gtk_icon_view_get_model (GtkIconView *icon_view);
Returns the model the GtkIconView is based on. Returns
Since 2.6 gtk_icon_view_set_text_column ()void gtk_icon_view_set_text_column (GtkIconView *icon_view, gint column);
Sets the column with text for
Since 2.6 gtk_icon_view_get_text_column ()gint gtk_icon_view_get_text_column (GtkIconView *icon_view);
Returns the column with text for
Since 2.6 gtk_icon_view_set_markup_column ()void gtk_icon_view_set_markup_column (GtkIconView *icon_view, gint column);
Sets the column with markup information for
Since 2.6 gtk_icon_view_get_markup_column ()gint gtk_icon_view_get_markup_column (GtkIconView *icon_view);
Returns the column with markup text for
Since 2.6 gtk_icon_view_set_pixbuf_column ()void gtk_icon_view_set_pixbuf_column (GtkIconView *icon_view, gint column);
Sets the column with pixbufs for
Since 2.6 gtk_icon_view_get_pixbuf_column ()gint gtk_icon_view_get_pixbuf_column (GtkIconView *icon_view);
Returns the column with pixbufs for
Since 2.6 gtk_icon_view_get_path_at_pos ()GtkTreePath* gtk_icon_view_get_path_at_pos (GtkIconView *icon_view, gint x, gint y);
Finds the path at the point (
Since 2.6 gtk_icon_view_get_item_at_pos ()gboolean gtk_icon_view_get_item_at_pos (GtkIconView *icon_view, gint x, gint y, GtkTreePath **path, GtkCellRenderer **cell);
Finds the path at the point (
Since 2.8 gtk_icon_view_convert_widget_to_bin_window_coords ()void gtk_icon_view_convert_widget_to_bin_window_coords
(GtkIconView *icon_view,
gint wx,
gint wy,
gint *bx,
gint *by);
Converts widget coordinates to coordinates for the bin_window,
as expected by e.g.
Since 2.12 gtk_icon_view_set_cursor ()void gtk_icon_view_set_cursor (GtkIconView *icon_view, GtkTreePath *path, GtkCellRenderer *cell, gboolean start_editing);
Sets the current keyboard focus to be at
This function is often followed by
Since 2.8 gtk_icon_view_get_cursor ()gboolean gtk_icon_view_get_cursor (GtkIconView *icon_view, GtkTreePath **path, GtkCellRenderer **cell);
Fills in
The returned GtkTreePath must be freed with
Since 2.8 gtk_icon_view_selected_foreach ()void gtk_icon_view_selected_foreach (GtkIconView *icon_view, GtkIconViewForeachFunc func, gpointer data); Calls a function for each selected icon. Note that the model or selection cannot be modified from within this function.
Since 2.6 gtk_icon_view_set_selection_mode ()void gtk_icon_view_set_selection_mode (GtkIconView *icon_view, GtkSelectionMode mode);
Sets the selection mode of the
Since 2.6 gtk_icon_view_get_selection_mode ()GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView *icon_view);
Gets the selection mode of the
Since 2.6 gtk_icon_view_set_orientation ()void gtk_icon_view_set_orientation (GtkIconView *icon_view, GtkOrientation orientation); Sets the ::orientation property which determines whether the labels are drawn beside the icons instead of below.
Since 2.6 gtk_icon_view_get_orientation ()GtkOrientation gtk_icon_view_get_orientation (GtkIconView *icon_view); Returns the value of the ::orientation property which determines whether the labels are drawn beside the icons instead of below.
Since 2.6 gtk_icon_view_set_columns ()void gtk_icon_view_set_columns (GtkIconView *icon_view, gint columns);
Sets the ::columns property which determines in how
many columns the icons are arranged. If
Since 2.6 gtk_icon_view_get_columns ()gint gtk_icon_view_get_columns (GtkIconView *icon_view); Returns the value of the ::columns property.
Since 2.6 gtk_icon_view_set_item_width ()void gtk_icon_view_set_item_width (GtkIconView *icon_view, gint item_width); Sets the ::item-width property which specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.
Since 2.6 gtk_icon_view_get_item_width ()gint gtk_icon_view_get_item_width (GtkIconView *icon_view); Returns the value of the ::item-width property.
Since 2.6 gtk_icon_view_set_spacing ()void gtk_icon_view_set_spacing (GtkIconView *icon_view, gint spacing); Sets the ::spacing property which specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
Since 2.6 gtk_icon_view_get_spacing ()gint gtk_icon_view_get_spacing (GtkIconView *icon_view); Returns the value of the ::spacing property.
Since 2.6 gtk_icon_view_set_row_spacing ()void gtk_icon_view_set_row_spacing (GtkIconView *icon_view, gint row_spacing); Sets the ::row-spacing property which specifies the space which is inserted between the rows of the icon view.
Since 2.6 gtk_icon_view_get_row_spacing ()gint gtk_icon_view_get_row_spacing (GtkIconView *icon_view); Returns the value of the ::row-spacing property.
Since 2.6 gtk_icon_view_set_column_spacing ()void gtk_icon_view_set_column_spacing (GtkIconView *icon_view, gint column_spacing); Sets the ::column-spacing property which specifies the space which is inserted between the columns of the icon view.
Since 2.6 gtk_icon_view_get_column_spacing ()gint gtk_icon_view_get_column_spacing (GtkIconView *icon_view); Returns the value of the ::column-spacing property.
Since 2.6 gtk_icon_view_set_margin ()void gtk_icon_view_set_margin (GtkIconView *icon_view, gint margin); Sets the ::margin property which specifies the space which is inserted at the top, bottom, left and right of the icon view.
Since 2.6 gtk_icon_view_get_margin ()gint gtk_icon_view_get_margin (GtkIconView *icon_view); Returns the value of the ::margin property.
Since 2.6 gtk_icon_view_select_path ()void gtk_icon_view_select_path (GtkIconView *icon_view, GtkTreePath *path);
Selects the row at
Since 2.6 gtk_icon_view_unselect_path ()void gtk_icon_view_unselect_path (GtkIconView *icon_view, GtkTreePath *path);
Unselects the row at
Since 2.6 gtk_icon_view_path_is_selected ()gboolean gtk_icon_view_path_is_selected (GtkIconView *icon_view, GtkTreePath *path);
Returns
Since 2.6 gtk_icon_view_get_selected_items ()GList* gtk_icon_view_get_selected_items (GtkIconView *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 To free the return value, use: g_list_foreach (list, gtk_tree_path_free, NULL); g_list_free (list);
Since 2.6 gtk_icon_view_select_all ()void gtk_icon_view_select_all (GtkIconView *icon_view);
Selects all the icons.
Since 2.6 gtk_icon_view_unselect_all ()void gtk_icon_view_unselect_all (GtkIconView *icon_view); Unselects all the icons.
Since 2.6 gtk_icon_view_item_activated ()void gtk_icon_view_item_activated (GtkIconView *icon_view, GtkTreePath *path);
Activates the item determined by
Since 2.6 gtk_icon_view_scroll_to_path ()void gtk_icon_view_scroll_to_path (GtkIconView *icon_view, GtkTreePath *path, gboolean use_align, gfloat row_align, gfloat col_align);
Moves the alignments of
If
This function only works if the model is set, and
Since 2.8 gtk_icon_view_get_visible_range ()gboolean gtk_icon_view_get_visible_range (GtkIconView *icon_view, GtkTreePath **start_path, GtkTreePath **end_path);
Sets
Both paths should be freed with
Since 2.8 gtk_icon_view_set_tooltip_item ()void gtk_icon_view_set_tooltip_item (GtkIconView *icon_view, GtkTooltip *tooltip, GtkTreePath *path);
Sets the tip area of
Since 2.12 gtk_icon_view_set_tooltip_cell ()void gtk_icon_view_set_tooltip_cell (GtkIconView *icon_view, GtkTooltip *tooltip, GtkTreePath *path, GtkCellRenderer *cell);
Sets the tip area of
Since 2.12 gtk_icon_view_get_tooltip_context ()gboolean gtk_icon_view_get_tooltip_context (GtkIconView *icon_view, gint *x, gint *y, gboolean keyboard_tip, GtkTreeModel **model, GtkTreePath **path, GtkTreeIter *iter);
This function is supposed to be used in a "query-tooltip"
signal handler for GtkIconView. The
The return value indicates whether there is an icon view item at the given
coordinates (
Since 2.12 gtk_icon_view_set_tooltip_column ()void gtk_icon_view_set_tooltip_column (GtkIconView *icon_view, gint column);
If you only plan to have simple (text-only) tooltips on full items, you
can use this function to have GtkIconView handle these automatically
for you.
When enabled, "has-tooltip" will be set to
Since 2.12 gtk_icon_view_get_tooltip_column ()gint gtk_icon_view_get_tooltip_column (GtkIconView *icon_view);
Returns the column of
Since 2.12 enum GtkIconViewDropPositiontypedef enum
{
GTK_ICON_VIEW_NO_DROP,
GTK_ICON_VIEW_DROP_INTO,
GTK_ICON_VIEW_DROP_LEFT,
GTK_ICON_VIEW_DROP_RIGHT,
GTK_ICON_VIEW_DROP_ABOVE,
GTK_ICON_VIEW_DROP_BELOW
} GtkIconViewDropPosition;
An enum for determining where a dropped item goes.
gtk_icon_view_enable_model_drag_source ()void gtk_icon_view_enable_model_drag_source
(GtkIconView *icon_view,
GdkModifierType start_button_mask,
const GtkTargetEntry *targets,
gint n_targets,
GdkDragAction actions);
Turns
Since 2.8 gtk_icon_view_enable_model_drag_dest ()void gtk_icon_view_enable_model_drag_dest
(GtkIconView *icon_view,
const GtkTargetEntry *targets,
gint n_targets,
GdkDragAction actions);
Turns
Since 2.8 gtk_icon_view_unset_model_drag_source ()void gtk_icon_view_unset_model_drag_source
(GtkIconView *icon_view);
Undoes the effect of
Since 2.8 gtk_icon_view_unset_model_drag_dest ()void gtk_icon_view_unset_model_drag_dest (GtkIconView *icon_view);
Undoes the effect of
Since 2.8 gtk_icon_view_set_reorderable ()void gtk_icon_view_set_reorderable (GtkIconView *icon_view, gboolean reorderable);
This function is a convenience function to allow you to reorder models that
support the GtkTreeDragSourceIface and the GtkTreeDragDestIface. Both
GtkTreeStore and GtkListStore support these. If This function does not give you any degree of control over the order -- any reordering is allowed. If more control is needed, you should probably handle drag and drop manually.
Since 2.8 gtk_icon_view_get_reorderable ()gboolean gtk_icon_view_get_reorderable (GtkIconView *icon_view);
Retrieves whether the user can reorder the list via drag-and-drop.
See
Since 2.8 gtk_icon_view_set_drag_dest_item ()void gtk_icon_view_set_drag_dest_item (GtkIconView *icon_view, GtkTreePath *path, GtkIconViewDropPosition pos); Sets the item that is highlighted for feedback.
Since 2.8 gtk_icon_view_get_drag_dest_item ()void gtk_icon_view_get_drag_dest_item (GtkIconView *icon_view, GtkTreePath **path, GtkIconViewDropPosition *pos); Gets information about the item that is highlighted for feedback.
Since 2.8 gtk_icon_view_get_dest_item_at_pos ()gboolean gtk_icon_view_get_dest_item_at_pos (GtkIconView *icon_view, gint drag_x, gint drag_y, GtkTreePath **path, GtkIconViewDropPosition *pos); Determines the destination item for a given position.
Since 2.8 gtk_icon_view_create_drag_icon ()GdkPixmap* gtk_icon_view_create_drag_icon (GtkIconView *icon_view, GtkTreePath *path);
Creates a GdkPixmap representation of the item at
Since 2.8 Property DetailsThe
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
Returns : |
"item-activated" signalvoid user_function (GtkIconView *iconview, GtkTreePath *arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"move-cursor" signalgboolean user_function (GtkIconView *iconview, GtkMovementStep arg1, gint arg2, gpointer user_data) : Run Last / Action
|
the object which received the signal. |
|
|
|
|
|
user data set when the signal handler was connected. |
Returns : |
"select-all" signalvoid user_function (GtkIconView *iconview, gpointer user_data) : Run Last / Action
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"select-cursor-item" signalvoid user_function (GtkIconView *iconview, gpointer user_data) : Run Last / Action
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"selection-changed" signalvoid user_function (GtkIconView *iconview, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"set-scroll-adjustments" signalvoid user_function (GtkIconView *iconview, GtkAdjustment *arg1, GtkAdjustment *arg2, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
|
|
user data set when the signal handler was connected. |
"toggle-cursor-item" signalvoid user_function (GtkIconView *iconview, gpointer user_data) : Run Last / Action
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"unselect-all" signalvoid user_function (GtkIconView *iconview, gpointer user_data) : Run Last / Action
|
the object which received the signal. |
|
user data set when the signal handler was connected. |