gtk.icon_view
Module for [IconView] class
Types 3
#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.IconView.setSelectionMode]). 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.
IconViewGidBuilder builder()Get builder for [gtk.icon_view.IconView] Returns: New builder objectbool activateOnSingleClick() @propertyGet `activateOnSingleClick` property. Returns: The activate-on-single-click property specifies whether the "item-activated" signal will be emitted after a single click.void activateOnSingleClick(bool propval) @propertySet `activateOnSingleClick` property. Params: propval = The activate-on-single-click property specifies whether the "item-activated" signal will be emitted after a single click.gtk.cell_area.CellArea cellArea() @propertyGet `cellArea` property. Returns: The #GtkCellArea used to layout cell renderers for this view.int columnSpacing() @propertyGet `columnSpacing` property. Returns: The column-spacing property specifies the space which is inserted between the columns of the icon view.void columnSpacing(int propval) @propertySet `columnSpacing` property. Params: propval = The column-spacing property specifies the space which is inserted between the columns of the icon view.int columns() @propertyGet `columns` property. Returns: 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 f...void columns(int propval) @propertySet `columns` property. Params: propval = 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 automatic...gtk.types.Orientation itemOrientation() @propertyGet `itemOrientation` property. Returns: The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.void itemOrientation(gtk.types.Orientation propval) @propertySet `itemOrientation` property. Params: propval = The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.int itemPadding() @propertyGet `itemPadding` property. Returns: The item-padding property specifies the padding around each of the icon view's item.void itemPadding(int propval) @propertySet `itemPadding` property. Params: propval = The item-padding property specifies the padding around each of the icon view's item.int itemWidth() @propertyGet `itemWidth` property. Returns: 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.void itemWidth(int propval) @propertySet `itemWidth` property. Params: propval = 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.int margin() @propertyGet `margin` property. Returns: The margin property specifies the space which is inserted at the edges of the icon view.void margin(int propval) @propertySet `margin` property. Params: propval = The margin property specifies the space which is inserted at the edges of the icon view.int markupColumn() @propertyGet `markupColumn` property. Returns: The ::markup-column property contains the number of the model column containing markup information to be displayed. The markup column must be of type #GTYPESTR...void markupColumn(int propval) @propertySet `markupColumn` property. Params: propval = The ::markup-column property contains the number of the model column containing markup information to be displayed. The markup column must be of type ...gtk.tree_model.TreeModel model() @propertyvoid model(gtk.tree_model.TreeModel propval) @propertyint pixbufColumn() @propertyGet `pixbufColumn` property. Returns: The ::pixbuf-column property contains the number of the model column containing the pixbufs which are displayed. The pixbuf column must be of type #GDKTYPEPIXB...void pixbufColumn(int propval) @propertySet `pixbufColumn` property. Params: propval = The ::pixbuf-column property contains the number of the model column containing the pixbufs which are displayed. The pixbuf column must be of type #GD...bool reorderable() @propertyGet `reorderable` property. Returns: The reorderable property specifies if the items can be reordered by DND.void reorderable(bool propval) @propertySet `reorderable` property. Params: propval = The reorderable property specifies if the items can be reordered by DND.int rowSpacing() @propertyGet `rowSpacing` property. Returns: The row-spacing property specifies the space which is inserted between the rows of the icon view.void rowSpacing(int propval) @propertySet `rowSpacing` property. Params: propval = The row-spacing property specifies the space which is inserted between the rows of the icon view.gtk.types.SelectionMode selectionMode() @propertyGet `selectionMode` property. Returns: The ::selection-mode property specifies the selection mode of icon view. If the mode is #GTKSELECTIONMULTIPLE, rubberband selection is enabled, for the other ...void selectionMode(gtk.types.SelectionMode propval) @propertySet `selectionMode` property. Params: propval = The ::selection-mode property specifies the selection mode of icon view. If the mode is #GTKSELECTIONMULTIPLE, rubberband selection is enabled, for t...int spacing() @propertyGet `spacing` property. Returns: The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.void spacing(int propval) @propertySet `spacing` property. Params: propval = The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.int textColumn() @propertyGet `textColumn` property. Returns: The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type #GTYPESTRING. If thi...void textColumn(int propval) @propertySet `textColumn` property. Params: propval = The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type #GTYPESTRIN...int tooltipColumn() @propertyvoid tooltipColumn(int propval) @propertygtk.icon_view.IconView newWithArea(gtk.cell_area.CellArea area)Creates a new #GtkIconView widget using the specified area to layout cells inside the icons.gtk.icon_view.IconView newWithModel(gtk.tree_model.TreeModel model)Creates a new #GtkIconView widget with the model model.void convertWidgetToBinWindowCoords(int wx, int wy, out int bx, out int by)Converts widget coordinates to coordinates for the binwindow, as expected by e.g. [gtk.iconview.IconView.getPathAtPos].cairo.surface.Surface createDragIcon(gtk.tree_path.TreePath path)Creates a #cairosurfacet representation of the item at path. This image is used for a drag icon.void enableModelDragDest(gtk.target_entry.TargetEntry[] targets, gdk.types.DragAction actions)Turns icon_view into a drop destination for automatic DND. Calling this method sets #GtkIconView:reorderable to false.void enableModelDragSource(gdk.types.ModifierType startButtonMask, gtk.target_entry.TargetEntry[] targets, gdk.types.DragAction actions)Turns icon_view into a drag source for automatic DND. Calling this method sets #GtkIconView:reorderable to false.bool getActivateOnSingleClick()Gets the setting set by [gtk.icon_view.IconView.setActivateOnSingleClick]. Returns: true if item-activated will be emitted on a single clickbool getCellRect(gtk.tree_path.TreePath path, gtk.cell_renderer.CellRenderer cell, out gdk.rectangle.Rectangle 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.int getColumnSpacing()Returns the value of the ::column-spacing property. Returns: the space between columnsint getColumns()Returns the value of the ::columns property. Returns: the number of columns, or -1bool getCursor(out gtk.tree_path.TreePath path, out gtk.cell_renderer.CellRenderer cell)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.bool getDestItemAtPos(int dragX, int dragY, out gtk.tree_path.TreePath path, out gtk.types.IconViewDropPosition pos)Determines the destination item for a given position.void getDragDestItem(out gtk.tree_path.TreePath path, out gtk.types.IconViewDropPosition pos)Gets information about the item that is highlighted for feedback.bool getItemAtPos(int x, int y, out gtk.tree_path.TreePath path, out gtk.cell_renderer.CellRenderer cell)Finds the path at the point (`x`, `y`), relative to binwindow coordinates. In contrast to [gtk.iconview.IconView.getPathAtPos], this function also obtains the cell at the specified position. The re...int getItemColumn(gtk.tree_path.TreePath path)Gets the column in which the item path is currently displayed. Column numbers start at 0.gtk.types.Orientation getItemOrientation()Returns the value of the ::item-orientation property which determines whether the labels are drawn beside the icons instead of below. Returns: the relative position of texts and iconsint getItemPadding()Returns the value of the ::item-padding property. Returns: the padding around itemsint getItemRow(gtk.tree_path.TreePath path)Gets the row in which the item path is currently displayed. Row numbers start at 0.int getItemWidth()Returns the value of the ::item-width property. Returns: the width of a single item, or -1int getMargin()Returns the value of the ::margin property. Returns: the space at the bordersint getMarkupColumn()Returns the column with markup text for icon_view. Returns: the markup column, or -1 if it’s unset.gtk.tree_model.TreeModel getModel()Returns the model the #GtkIconView is based on. Returns null if the model is unset. Returns: A #GtkTreeModel, or null if none is currently being used.gtk.tree_path.TreePath getPathAtPos(int x, int y)Finds the path at the point (`x`, `y`), relative to binwindow coordinates. See [gtk.iconview.IconView.getItemAtPos], if you are also interested in the cell at the specified position. See [gtk.iconv...int getPixbufColumn()Returns the column with pixbufs for icon_view. Returns: the pixbuf column, or -1 if it’s unset.bool getReorderable()Retrieves whether the user can reorder the list via drag-and-drop. See [gtk.icon_view.IconView.setReorderable]. Returns: true if the list can be reordered.int getRowSpacing()Returns the value of the ::row-spacing property. Returns: the space between rowsgtk.tree_path.TreePath[] getSelectedItems()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 #GtkTre...gtk.types.SelectionMode getSelectionMode()Gets the selection mode of the icon_view. Returns: the current selection modeint getSpacing()Returns the value of the ::spacing property. Returns: the space between cellsint getTextColumn()Returns the column with text for icon_view. Returns: the text column, or -1 if it’s unset.int getTooltipColumn()Returns the column of iconview’s model which is being used for displaying tooltips on iconview’s rows. Returns: the index of the tooltip column that is currently being used, or -1 if this is di...bool getTooltipContext(ref int x, ref int y, bool keyboardTip, out gtk.tree_model.TreeModel model, out gtk.tree_path.TreePath path, out gtk.tree_iter.TreeIter iter)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...bool getVisibleRange(out gtk.tree_path.TreePath startPath, out gtk.tree_path.TreePath endPath)Sets startpath and endpath to be the first and last visible path. Note that there may be invisible paths in between.void itemActivated(gtk.tree_path.TreePath path)Activates the item determined by path.bool pathIsSelected(gtk.tree_path.TreePath path)Returns true if the icon pointed to by path is currently selected. If path does not point to a valid location, false is returned.void scrollToPath(gtk.tree_path.TreePath path, bool useAlign, float rowAlign, float colAlign)Moves the alignments of iconview to the position specified by path. rowalign determines where the row is placed, and col_align determines where column is placed. Both are expected to be between 0....void selectAll()Selects all the icons. iconview must has its selection mode set to #GTKSELECTION_MULTIPLE.void selectPath(gtk.tree_path.TreePath path)Selects the row at path.void selectedForeach(gtk.types.IconViewForeachFunc func)Calls a function for each selected icon. Note that the model or selection cannot be modified from within this function.void setActivateOnSingleClick(bool single)Causes the #GtkIconView::item-activated signal to be emitted on a single click instead of a double click.void setColumnSpacing(int columnSpacing)Sets the ::column-spacing property which specifies the space which is inserted between the columns of the icon view.void setColumns(int 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.void setCursor(gtk.tree_path.TreePath path, gtk.cell_renderer.CellRenderer cell, bool startEditing)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 ce...void setDragDestItem(gtk.tree_path.TreePath path, gtk.types.IconViewDropPosition pos)Sets the item that is highlighted for feedback.void setItemOrientation(gtk.types.Orientation orientation)Sets the ::item-orientation property which determines whether the labels are drawn beside the icons instead of below.void setItemPadding(int itemPadding)Sets the #GtkIconView:item-padding property which specifies the padding around each of the icon view’s items.void setItemWidth(int itemWidth)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.void setMargin(int margin)Sets the ::margin property which specifies the space which is inserted at the top, bottom, left and right of the icon view.void setMarkupColumn(int column)Sets the column with markup information for iconview to be column. The markup column must be of type #GTYPESTRING. If the markup column is set to something, it overrides the text column set by [gtk...void setModel(gtk.tree_model.TreeModel model = null)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.void setPixbufColumn(int column)Sets the column with pixbufs for iconview to be column. The pixbuf column must be of type #GDKTYPE_PIXBUFvoid setReorderable(bool 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. ...void setRowSpacing(int rowSpacing)Sets the ::row-spacing property which specifies the space which is inserted between the rows of the icon view.void setSelectionMode(gtk.types.SelectionMode mode)Sets the selection mode of the icon_view.void setSpacing(int 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.void setTextColumn(int column)Sets the column with text for iconview to be column. The text column must be of type #GTYPE_STRING.void setTooltipCell(gtk.tooltip.Tooltip tooltip, gtk.tree_path.TreePath path, gtk.cell_renderer.CellRenderer cell = null)Sets the tip area of tooltip to the area which cell occupies in the item pointed to by path. See also [gtk.tooltip.Tooltip.setTipArea].void setTooltipColumn(int 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_vie...void setTooltipItem(gtk.tooltip.Tooltip tooltip, gtk.tree_path.TreePath path)Sets the tip area of tooltip to be the area covered by the item at path. See also [gtk.icon_view.IconView.setTooltipColumn] for a simpler alternative. See also [gtk.tooltip.Tooltip.setTipArea].void unselectAll()Unselects all the icons.void unselectPath(gtk.tree_path.TreePath path)Unselects the row at path.void unsetModelDragDest()Undoes the effect of [gtk.icon_view.IconView.enableModelDragDest]. Calling this method sets #GtkIconView:reorderable to false.void unsetModelDragSource()Undoes the effect of [gtk.icon_view.IconView.enableModelDragSource]. Calling this method sets #GtkIconView:reorderable to false.gulong connectActivateCursorItem(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.icon_view.IconView)))
&& Parameters!T.length < 2)Connect to `ActivateCursorItem` signal.gulong connectItemActivated(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.tree_path.TreePath)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.icon_view.IconView)))
&& Parameters!T.length < 3)Connect to `ItemActivated` signal.gulong connectMoveCursor(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.types.MovementStep)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == int)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtk.icon_view.IconView)))
&& Parameters!T.length < 4)Connect to `MoveCursor` signal.gulong connectSelectAll(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.icon_view.IconView)))
&& Parameters!T.length < 2)Connect to `SelectAll` signal.gulong connectSelectCursorItem(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.icon_view.IconView)))
&& Parameters!T.length < 2)Connect to `SelectCursorItem` signal.gulong connectSelectionChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.icon_view.IconView)))
&& Parameters!T.length < 2)Connect to `SelectionChanged` signal.gulong connectToggleCursorItem(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.icon_view.IconView)))
&& Parameters!T.length < 2)Connect to `ToggleCursorItem` signal.gulong connectUnselectAll(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.icon_view.IconView)))
&& Parameters!T.length < 2)Connect to `UnselectAll` signal.T activateOnSingleClick(bool propval)Set `activateOnSingleClick` property. Params: propval = The activate-on-single-click property specifies whether the "item-activated" signal will be emitted after a single click. Returns: Builder in...T cellArea(gtk.cell_area.CellArea propval)Set `cellArea` property. Params: propval = The #GtkCellArea used to layout cell renderers for this view.T columnSpacing(int propval)Set `columnSpacing` property. Params: propval = The column-spacing property specifies the space which is inserted between the columns of the icon view. Returns: Builder instance for fluent chainingT columns(int propval)Set `columns` property. Params: propval = 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 automatic...T itemOrientation(gtk.types.Orientation propval)Set `itemOrientation` property. Params: propval = The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other. Returns: Buil...T itemPadding(int propval)Set `itemPadding` property. Params: propval = The item-padding property specifies the padding around each of the icon view's item. Returns: Builder instance for fluent chainingT itemWidth(int propval)Set `itemWidth` property. Params: propval = 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. Re...T margin(int propval)Set `margin` property. Params: propval = The margin property specifies the space which is inserted at the edges of the icon view. Returns: Builder instance for fluent chainingT markupColumn(int propval)Set `markupColumn` property. Params: propval = The ::markup-column property contains the number of the model column containing markup information to be displayed. The markup column must be of type ...T model(gtk.tree_model.TreeModel propval)T pixbufColumn(int propval)Set `pixbufColumn` property. Params: propval = The ::pixbuf-column property contains the number of the model column containing the pixbufs which are displayed. The pixbuf column must be of type #GD...T reorderable(bool propval)Set `reorderable` property. Params: propval = The reorderable property specifies if the items can be reordered by DND. Returns: Builder instance for fluent chainingT rowSpacing(int propval)Set `rowSpacing` property. Params: propval = The row-spacing property specifies the space which is inserted between the rows of the icon view. Returns: Builder instance for fluent chainingT selectionMode(gtk.types.SelectionMode propval)Set `selectionMode` property. Params: propval = The ::selection-mode property specifies the selection mode of icon view. If the mode is #GTKSELECTIONMULTIPLE, rubberband selection is enabled, for t...T spacing(int propval)Set `spacing` property. Params: propval = The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item. Returns: Builder instance for fluent ...T textColumn(int propval)Set `textColumn` property. Params: propval = The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type #GTYPESTRIN...T tooltipColumn(int propval)