Class

Gtk.IconView

Description [src]

final class Gtk.IconView : Gtk.Widget {
  /* No available fields */
}

GtkIconView provides an alternative view on a GtkTreeModel. 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 gtk_icon_view_set_selection_mode()). In addition to selection with the arrow keys, GtkIconView supports rubberband selection, which is controlled by dragging the pointer.

Note that if the tree model is backed by an actual tree store (as opposed to a flat list where the mapping to icons is obvious), GtkIconView will only display the first level of the tree and ignore the tree’s branches.

CSS nodes

iconview.view
╰── [rubberband]

GtkIconView has a single CSS node with name iconview and style class .view. For rubberband selection, a subnode with name rubberband is used.

Ancestors

Constructors

gtk_icon_view_new

Creates a new GtkIconView widget

gtk_icon_view_new_with_area

Creates a new GtkIconView widget using the specified area to layout cells inside the icons.

gtk_icon_view_new_with_model

Creates a new GtkIconView widget with the model model.

Instance methods

gtk_icon_view_create_drag_icon

Creates a #cairo_surface_t representation of the item at path. This image is used for a drag icon.

gtk_icon_view_enable_model_drag_dest

Turns icon_view into a drop destination for automatic DND. Calling this method sets GtkIconView:reorderable to FALSE.

gtk_icon_view_enable_model_drag_source

Turns icon_view into a drag source for automatic DND. Calling this method sets GtkIconView:reorderable to FALSE.

gtk_icon_view_get_activate_on_single_click

Gets the setting set by gtk_icon_view_set_activate_on_single_click().

gtk_icon_view_get_cell_rect

Fills the bounding rectangle in widget coordinates for the cell specified by path and cell. If cell is NULL the main cell area is used.

gtk_icon_view_get_column_spacing

Returns the value of the ::column-spacing property.

gtk_icon_view_get_columns

Returns the value of the ::columns property.

gtk_icon_view_get_cursor

Fills in path and cell with the current cursor path and cell. If the cursor isn’t currently set, then path will be NULL. If no cell currently has focus, then cell will be NULL.

gtk_icon_view_get_dest_item_at_pos

Determines the destination item for a given position.

gtk_icon_view_get_drag_dest_item

Gets information about the item that is highlighted for feedback.

gtk_icon_view_get_item_at_pos

Gets the path and cell for the icon at the given position.

gtk_icon_view_get_item_column

Gets the column in which the item path is currently displayed. Column numbers start at 0.

gtk_icon_view_get_item_orientation

Returns the value of the ::item-orientation property which determines whether the labels are drawn beside the icons instead of below.

gtk_icon_view_get_item_padding

Returns the value of the ::item-padding property.

gtk_icon_view_get_item_row

Gets the row in which the item path is currently displayed. Row numbers start at 0.

gtk_icon_view_get_item_width

Returns the value of the ::item-width property.

gtk_icon_view_get_margin

Returns the value of the ::margin property.

gtk_icon_view_get_markup_column

Returns the column with markup text for icon_view.

gtk_icon_view_get_model

Returns the model the GtkIconView is based on. Returns NULL if the model is unset.

gtk_icon_view_get_path_at_pos

Gets the path for the icon at the given position.

gtk_icon_view_get_pixbuf_column

Returns the column with pixbufs for icon_view.

gtk_icon_view_get_reorderable

Retrieves whether the user can reorder the list via drag-and-drop. See gtk_icon_view_set_reorderable().

gtk_icon_view_get_row_spacing

Returns the value of the ::row-spacing property.

gtk_icon_view_get_selected_items

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().

gtk_icon_view_get_selection_mode

Gets the selection mode of the icon_view.

gtk_icon_view_get_spacing

Returns the value of the ::spacing property.

gtk_icon_view_get_text_column

Returns the column with text for icon_view.

gtk_icon_view_get_tooltip_column

Returns the column of icon_view’s model which is being used for displaying tooltips on icon_view’s rows.

gtk_icon_view_get_tooltip_context

This function is supposed to be used in a GtkWidget::query-tooltip signal handler for GtkIconView. The x, y and keyboard_tip values which are received in the signal handler, should be passed to this function without modification.

gtk_icon_view_get_visible_range

Sets start_path and end_path to be the first and last visible path. Note that there may be invisible paths in between.

gtk_icon_view_item_activated

Activates the item determined by path.

gtk_icon_view_path_is_selected

Returns TRUE if the icon pointed to by path is currently selected. If path does not point to a valid location, FALSE is returned.

gtk_icon_view_scroll_to_path

Moves the alignments of icon_view to the position specified by path. row_align determines where the row is placed, and col_align determines where column is placed. Both are expected to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means center.

gtk_icon_view_select_all

Selects all the icons. icon_view must has its selection mode set to #GTK_SELECTION_MULTIPLE.

gtk_icon_view_select_path

Selects the row at path.

gtk_icon_view_selected_foreach

Calls a function for each selected icon. Note that the model or selection cannot be modified from within this function.

gtk_icon_view_set_activate_on_single_click

Causes the GtkIconView::item-activated signal to be emitted on a single click instead of a double click.

gtk_icon_view_set_column_spacing

Sets the ::column-spacing property which specifies the space which is inserted between the columns of the icon view.

gtk_icon_view_set_columns

Sets the ::columns property which determines in how many columns the icons are arranged. If columns is -1, the number of columns will be chosen automatically to fill the available area.

gtk_icon_view_set_cursor

Sets the current keyboard focus to be at path, and selects it. This is useful when you want to focus the user’s attention on a particular item. If cell is not NULL, then focus is given to the cell specified by it. Additionally, if start_editing is TRUE, then editing should be started in the specified cell.

gtk_icon_view_set_drag_dest_item

Sets the item that is highlighted for feedback.

gtk_icon_view_set_item_orientation

Sets the ::item-orientation property which determines whether the labels are drawn beside the icons instead of below.

gtk_icon_view_set_item_padding

Sets the GtkIconView:item-padding property which specifies the padding around each of the icon view’s items.

gtk_icon_view_set_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.

gtk_icon_view_set_margin

Sets the ::margin property which specifies the space which is inserted at the top, bottom, left and right of the icon view.

gtk_icon_view_set_markup_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 gtk_icon_view_set_text_column().

gtk_icon_view_set_model

Sets the model for a GtkIconView. 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.

gtk_icon_view_set_pixbuf_column

Sets the column with pixbufs for icon_view to be column. The pixbuf column must be of type #GDK_TYPE_PIXBUF

gtk_icon_view_set_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 reorderable is TRUE, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model’s row_inserted and row_deleted signals. The reordering is implemented by setting up the icon view as a drag source and destination. Therefore, drag and drop can not be used in a reorderable view for any other purpose.

gtk_icon_view_set_row_spacing

Sets the ::row-spacing property which specifies the space which is inserted between the rows of the icon view.

gtk_icon_view_set_selection_mode

Sets the selection mode of the icon_view.

gtk_icon_view_set_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.

gtk_icon_view_set_text_column

Sets the column with text for icon_view to be column. The text column must be of type #G_TYPE_STRING.

gtk_icon_view_set_tooltip_cell

Sets the tip area of tooltip to the area which cell occupies in the item pointed to by path. See also gtk_tooltip_set_tip_area().

gtk_icon_view_set_tooltip_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. column should be set to the column in icon_view’s model containing the tooltip texts, or -1 to disable this feature.

gtk_icon_view_set_tooltip_item

Sets the tip area of tooltip to be the area covered by the item at path. See also gtk_icon_view_set_tooltip_column() for a simpler alternative. See also gtk_tooltip_set_tip_area().

gtk_icon_view_unselect_all

Unselects all the icons.

gtk_icon_view_unselect_path

Unselects the row at path.

gtk_icon_view_unset_model_drag_dest

Undoes the effect of gtk_icon_view_enable_model_drag_dest(). Calling this method sets GtkIconView:reorderable to FALSE.

gtk_icon_view_unset_model_drag_source

Undoes the effect of gtk_icon_view_enable_model_drag_source(). Calling this method sets GtkIconView:reorderable to FALSE.

Methods inherited from GtkWidget (159)
Methods inherited from GtkAccessible (10)
gtk_accessible_get_accessible_role

Retrieves the GtkAccessibleRole for the given GtkAccessible.

gtk_accessible_reset_property

Resets the accessible property to its default value.

gtk_accessible_reset_relation

Resets the accessible relation to its default value.

gtk_accessible_reset_state

Resets the accessible state to its default value.

gtk_accessible_update_property

Updates a list of accessible properties.

gtk_accessible_update_property_value

Updates an array of accessible properties.

gtk_accessible_update_relation

Updates a list of accessible relations.

gtk_accessible_update_relation_value

Updates an array of accessible relations.

gtk_accessible_update_state

Updates a list of accessible states. See the GtkAccessibleState documentation for the value types of accessible states.

gtk_accessible_update_state_value

Updates an array of accessible states.

Methods inherited from GtkBuildable (1)
gtk_buildable_get_buildable_id

Gets the ID of the buildable object.

Methods inherited from GtkCellLayout (10)
gtk_cell_layout_add_attribute

Adds an attribute mapping to the list in cell_layout.

gtk_cell_layout_clear

Unsets all the mappings on all renderers on cell_layout and removes all renderers from cell_layout.

gtk_cell_layout_clear_attributes

Clears all existing attributes previously set with gtk_cell_layout_set_attributes().

gtk_cell_layout_get_area

Returns the underlying GtkCellArea which might be cell_layout if called on a GtkCellArea or might be NULL if no GtkCellArea is used by cell_layout.

gtk_cell_layout_get_cells

Returns the cell renderers which have been added to cell_layout.

gtk_cell_layout_pack_end

Adds the cell to the end of cell_layout. If expand is FALSE, then the cell is allocated no more space than it needs. Any unused space is divided evenly between cells for which expand is TRUE.

gtk_cell_layout_pack_start

Packs the cell into the beginning of cell_layout. If expand is FALSE, then the cell is allocated no more space than it needs. Any unused space is divided evenly between cells for which expand is TRUE.

gtk_cell_layout_reorder

Re-inserts cell at position.

gtk_cell_layout_set_attributes

Sets the attributes in list as the attributes of cell_layout.

gtk_cell_layout_set_cell_data_func

Sets the GtkCellLayoutDataFunc to use for cell_layout.

Methods inherited from GtkScrollable (9)
gtk_scrollable_get_border

Returns the size of a non-scrolling border around the outside of the scrollable. An example for this would be treeview headers. GTK can use this information to display overlaid graphics, like the overshoot indication, at the right position.

gtk_scrollable_get_hadjustment

Retrieves the GtkAdjustment used for horizontal scrolling.

gtk_scrollable_get_hscroll_policy

Gets the horizontal GtkScrollablePolicy.

gtk_scrollable_get_vadjustment

Retrieves the GtkAdjustment used for vertical scrolling.

gtk_scrollable_get_vscroll_policy

Gets the vertical GtkScrollablePolicy.

gtk_scrollable_set_hadjustment

Sets the horizontal adjustment of the GtkScrollable.

gtk_scrollable_set_hscroll_policy

Sets the GtkScrollablePolicy to determine whether horizontal scrolling should start below the minimum width or below the natural width.

gtk_scrollable_set_vadjustment

Sets the vertical adjustment of the GtkScrollable.

gtk_scrollable_set_vscroll_policy

Sets the GtkScrollablePolicy to determine whether vertical scrolling should start below the minimum height or below the natural height.

Properties

Gtk.IconView:activate-on-single-click

The activate-on-single-click property specifies whether the “item-activated” signal will be emitted after a single click.

Gtk.IconView:cell-area

The GtkCellArea used to layout cell renderers for this view.

Gtk.IconView:column-spacing

The column-spacing property specifies the space which is inserted between the columns of the icon view.

Gtk.IconView:columns

The columns property contains the number of the columns in which the items should be displayed. If it is -1, the number of columns will be chosen automatically to fill the available area.

Gtk.IconView:item-orientation

The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.

Gtk.IconView:item-padding

The item-padding property specifies the padding around each of the icon view’s item.

Gtk.IconView:item-width

The item-width property specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.

Gtk.IconView:margin

The margin property specifies the space which is inserted at the edges of the icon view.

Gtk.IconView:markup-column

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.

Gtk.IconView:model
No description available.
Gtk.IconView:pixbuf-column

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.

Gtk.IconView:reorderable

The reorderable property specifies if the items can be reordered by DND.

Gtk.IconView:row-spacing

The row-spacing property specifies the space which is inserted between the rows of the icon view.

Gtk.IconView:selection-mode

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.

Gtk.IconView:spacing

The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.

Gtk.IconView:text-column

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.

Gtk.IconView:tooltip-column
No description available.
Properties inherited from GtkWidget (34)
Gtk.Widget:can-focus

Whether the widget or any of its descendents can accept the input focus.

Gtk.Widget:can-target

Whether the widget can receive pointer events.

Gtk.Widget:css-classes

A list of css classes applied to this widget.

Gtk.Widget:css-name

The name of this widget in the CSS tree.

Gtk.Widget:cursor

The cursor used by widget.

Gtk.Widget:focus-on-click

Whether the widget should grab focus when it is clicked with the mouse.

Gtk.Widget:focusable

Whether this widget itself will accept the input focus.

Gtk.Widget:halign

How to distribute horizontal space if widget gets extra space.

Gtk.Widget:has-default

Whether the widget is the default widget.

Gtk.Widget:has-focus

Whether the widget has the input focus.

Gtk.Widget:has-tooltip

Enables or disables the emission of the ::query-tooltip signal on widget.

Gtk.Widget:height-request

Override for height request of the widget.

Gtk.Widget:hexpand

Whether to expand horizontally.

Gtk.Widget:hexpand-set

Whether to use the hexpand property.

Gtk.Widget:layout-manager

The GtkLayoutManager instance to use to compute the preferred size of the widget, and allocate its children.

Gtk.Widget:margin-bottom

Margin on bottom side of widget.

Gtk.Widget:margin-end

Margin on end of widget, horizontally.

Gtk.Widget:margin-start

Margin on start of widget, horizontally.

Gtk.Widget:margin-top

Margin on top side of widget.

Gtk.Widget:name

The name of the widget.

Gtk.Widget:opacity

The requested opacity of the widget.

Gtk.Widget:overflow

How content outside the widget’s content area is treated.

Gtk.Widget:parent

The parent widget of this widget.

Gtk.Widget:receives-default

Whether the widget will receive the default action when it is focused.

Gtk.Widget:root

The GtkRoot widget of the widget tree containing this widget.

Gtk.Widget:scale-factor

The scale factor of the widget.

Gtk.Widget:sensitive

Whether the widget responds to input.

Gtk.Widget:tooltip-markup

Sets the text of tooltip to be the given string, which is marked up with Pango markup.

Gtk.Widget:tooltip-text

Sets the text of tooltip to be the given string.

Gtk.Widget:valign

How to distribute vertical space if widget gets extra space.

Gtk.Widget:vexpand

Whether to expand vertically.

Gtk.Widget:vexpand-set

Whether to use the vexpand property.

Gtk.Widget:visible

Whether the widget is visible.

Gtk.Widget:width-request

Override for width request of the widget.

Properties inherited from GtkAccessible (1)
Gtk.Accessible:accessible-role

The accessible role of the given GtkAccessible implementation.

Properties inherited from GtkScrollable (4)
Gtk.Scrollable:hadjustment

Horizontal GtkAdjustment of the scrollable widget. This adjustment is shared between the scrollable widget and its parent.

Gtk.Scrollable:hscroll-policy

Determines whether horizontal scrolling should start once the scrollable widget is allocated less than its minimum width or less than its natural width.

Gtk.Scrollable:vadjustment

Vertical GtkAdjustment of the scrollable widget. This adjustment is shared between the scrollable widget and its parent.

Gtk.Scrollable:vscroll-policy

Determines whether vertical scrolling should start once the scrollable widget is allocated less than its minimum height or less than its natural height.

Signals

Gtk.IconView::activate-cursor-item

A [keybinding signal][GtkSignalAction] which gets emitted when the user activates the currently focused item.

Gtk.IconView::item-activated

The ::item-activated signal is emitted when the method gtk_icon_view_item_activated() is called, when the user double clicks an item with the “activate-on-single-click” property set to FALSE, or when the user single clicks an item when the “activate-on-single-click” property set to TRUE. It is also emitted when a non-editable item is selected and one of the keys: Space, Return or Enter is pressed.

Gtk.IconView::move-cursor

The ::move-cursor signal is a [keybinding signal][GtkSignalAction] which gets emitted when the user initiates a cursor movement.

Gtk.IconView::select-all

A [keybinding signal][GtkSignalAction] which gets emitted when the user selects all items.

Gtk.IconView::select-cursor-item

A [keybinding signal][GtkSignalAction] which gets emitted when the user selects the item that is currently focused.

Gtk.IconView::selection-changed

The ::selection-changed signal is emitted when the selection (i.e. the set of selected items) changes.

Gtk.IconView::toggle-cursor-item

A [keybinding signal][GtkSignalAction] which gets emitted when the user toggles whether the currently focused item is selected or not. The exact effect of this depend on the selection mode.

Gtk.IconView::unselect-all

A [keybinding signal][GtkSignalAction] which gets emitted when the user unselects all items.

Signals inherited from GtkWidget (13)
Gtk.Widget::destroy

Signals that all holders of a reference to the widget should release the reference that they hold.

Gtk.Widget::direction-changed

Emitted when the text direction of a widget changes.

Gtk.Widget::hide

Emitted when widget is hidden.

Gtk.Widget::keynav-failed

Emitted if keyboard navigation fails.

Gtk.Widget::map

Emitted when widget is going to be mapped.

Gtk.Widget::mnemonic-activate

Emitted when a widget is activated via a mnemonic.

Gtk.Widget::move-focus

Emitted when the focus is moved.

Gtk.Widget::query-tooltip

Emitted when the widgets tooltip is about to be shown.

Gtk.Widget::realize

Emitted when widget is associated with a GdkSurface.

Gtk.Widget::show

Emitted when widget is shown.

Gtk.Widget::state-flags-changed

Emitted when the widget state changes.

Gtk.Widget::unmap

Emitted when widget is going to be unmapped.

Gtk.Widget::unrealize

Emitted when the GdkSurface associated with widget is destroyed.