gtk.icon_view
Module for [IconView] class
Types 3
gtk.icon_view.IconView is a widget which displays data in a grid of icons.
gtk.icon_view.IconView provides an alternative view on a gtk.tree_model.TreeModel. It displays the model as a grid of icons with labels. Like gtk.tree_view.TreeView, 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, gtk.icon_view.IconView 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), gtk.icon_view.IconView will only display the first level of the tree and ignore the tree’s branches.
CSS nodes
iconview.view
╰── [rubberband]gtk.icon_view.IconView has a single CSS node with name iconview and style class .view. For rubberband selection, a subnode with name rubberband is used.
Deprecated
IconViewGidBuilder builder() static nothrowGet builder for [gtk.icon_view.IconView] Returns: New builder objectbool activateOnSingleClick() @property nothrowGet `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) @property nothrowSet `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() @property nothrowGet `cellArea` property. Returns: The [gtk.cell_area.CellArea] used to layout cell renderers for this view.int columnSpacing() @property nothrowGet `columnSpacing` property. Returns: The column-spacing property specifies the space which is inserted between the columns of the icon view.void columnSpacing(int propval) @property nothrowSet `columnSpacing` property. Params: propval = The column-spacing property specifies the space which is inserted between the columns of the icon view.int columns() @property nothrowGet `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) @property nothrowSet `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() @property nothrowGet `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) @property nothrowSet `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() @property nothrowGet `itemPadding` property. Returns: The item-padding property specifies the padding around each of the icon view's item.void itemPadding(int propval) @property nothrowSet `itemPadding` property. Params: propval = The item-padding property specifies the padding around each of the icon view's item.int itemWidth() @property nothrowGet `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) @property nothrowSet `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 markupColumn() @property nothrowGet `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 `G_TYPE_S...void markupColumn(int propval) @property nothrowSet `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 ...int pixbufColumn() @property nothrowGet `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 `GDK_TYPE_PI...void pixbufColumn(int propval) @property nothrowSet `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() @property nothrowGet `reorderable` property. Returns: The reorderable property specifies if the items can be reordered by DND.void reorderable(bool propval) @property nothrowSet `reorderable` property. Params: propval = The reorderable property specifies if the items can be reordered by DND.int rowSpacing() @property nothrowGet `rowSpacing` property. Returns: The row-spacing property specifies the space which is inserted between the rows of the icon view.void rowSpacing(int propval) @property nothrowSet `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() @property nothrowGet `selectionMode` property. Returns: The ::selection-mode property specifies the selection mode of icon view. If the mode is [gtk.types.SelectionMode.Multiple], rubberband selection is enabled, f...void selectionMode(gtk.types.SelectionMode propval) @property nothrowSet `selectionMode` property. Params: propval = The ::selection-mode property specifies the selection mode of icon view. If the mode is [gtk.types.SelectionMode.Multiple], rubberband selection is e...int spacing() @property nothrowGet `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) @property nothrowSet `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() @property nothrowGet `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 `G_TYPE_STRING`. If ...void textColumn(int propval) @property nothrowSet `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 `G_TYPE_STR...gtk.icon_view.IconView newWithArea(gtk.cell_area.CellArea area) static nothrowCreates a new [gtk.icon_view.IconView] widget using the specified area to layout cells inside the icons.gtk.icon_view.IconView newWithModel(gtk.tree_model.TreeModel model) static nothrowCreates a new [gtk.icon_view.IconView] widget with the model model.gdk.paintable.Paintable createDragIcon(gtk.tree_path.TreePath path) nothrowCreates a [gdk.paintable.Paintable] representation of the item at path. This image is used for a drag icon.void enableModelDragDest(gdk.content_formats.ContentFormats formats, gdk.types.DragAction actions) nothrowTurns icon_view into a drop destination for automatic DND. Calling this method sets [gtk.icon_view.IconView]:reorderable to false.void enableModelDragSource(gdk.types.ModifierType startButtonMask, gdk.content_formats.ContentFormats formats, gdk.types.DragAction actions) nothrowTurns icon_view into a drag source for automatic DND. Calling this method sets [gtk.icon_view.IconView]:reorderable to false.bool getActivateOnSingleClick() nothrowGets 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) nothrowFills 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() nothrowReturns the value of the ::column-spacing property. Returns: the space between columnsint getColumns() nothrowReturns 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) nothrowFills 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) nothrowDetermines the destination item for a given position.void getDragDestItem(out gtk.tree_path.TreePath path, out gtk.types.IconViewDropPosition pos) nothrowGets 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) nothrowGets the path and cell for the icon at the given position.int getItemColumn(gtk.tree_path.TreePath path) nothrowGets the column in which the item path is currently displayed. Column numbers start at 0.gtk.types.Orientation getItemOrientation() nothrowReturns 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() nothrowReturns the value of the ::item-padding property. Returns: the padding around itemsint getItemRow(gtk.tree_path.TreePath path) nothrowGets the row in which the item path is currently displayed. Row numbers start at 0.int getItemWidth() nothrowReturns the value of the ::item-width property. Returns: the width of a single item, or -1int getMargin() nothrowReturns the value of the ::margin property. Returns: the space at the bordersint getMarkupColumn() nothrowReturns the column with markup text for icon_view. Returns: the markup column, or -1 if it’s unset.gtk.tree_model.TreeModel getModel() nothrowReturns the model the [gtk.icon_view.IconView] is based on. Returns null if the model is unset. Returns: The currently used [gtk.tree_model.TreeModel]gtk.tree_path.TreePath getPathAtPos(int x, int y) nothrowGets the path for the icon at the given position.int getPixbufColumn() nothrowReturns the column with pixbufs for icon_view. Returns: the pixbuf column, or -1 if it’s unset.bool getReorderable() nothrowRetrieves 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() nothrowReturns the value of the ::row-spacing property. Returns: the space between rowsgtk.tree_path.TreePath[] getSelectedItems() nothrowCreates 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() nothrowGets the selection mode of the icon_view. Returns: the current selection modeint getSpacing() nothrowReturns the value of the ::spacing property. Returns: the space between cellsint getTextColumn() nothrowReturns the column with text for icon_view. Returns: the text column, or -1 if it’s unset.int getTooltipColumn() nothrowReturns the column of icon_view’s model which is being used for displaying tooltips on icon_view’s rows. Returns: the index of the tooltip column that is currently being used, or -1 if this is ...bool getTooltipContext(int x, int y, bool keyboardTip, out gtk.tree_model.TreeModel model, out gtk.tree_path.TreePath path, out gtk.tree_iter.TreeIter iter) nothrowThis function is supposed to be used in a `GtkWidget::query-tooltip` signal handler for [gtk.icon_view.IconView]. The `x`, `y` and keyboard_tip values which are received in the signal handler, shou...bool getVisibleRange(out gtk.tree_path.TreePath startPath, out gtk.tree_path.TreePath endPath) nothrowSets start_path and end_path to be the first and last visible path. Note that there may be invisible paths in between.bool pathIsSelected(gtk.tree_path.TreePath path) nothrowReturns 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) nothrowMoves 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 ...void selectAll() nothrowSelects all the icons. icon_view must has its selection mode set to [gtk.types.SelectionMode.Multiple].void selectedForeach(gtk.types.IconViewForeachFunc func) nothrowCalls a function for each selected icon. Note that the model or selection cannot be modified from within this function.void setActivateOnSingleClick(bool single) nothrowCauses the [gtk.icon_view.IconView]::item-activated signal to be emitted on a single click instead of a double click.void setColumnSpacing(int columnSpacing) nothrowSets the ::column-spacing property which specifies the space which is inserted between the columns of the icon view.void setColumns(int columns) nothrowSets 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) nothrowSets 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) nothrowSets the item that is highlighted for feedback.void setItemOrientation(gtk.types.Orientation orientation) nothrowSets the ::item-orientation property which determines whether the labels are drawn beside the icons instead of below.void setItemPadding(int itemPadding) nothrowSets the [gtk.icon_view.IconView]:item-padding property which specifies the padding around each of the icon view’s items.void setItemWidth(int itemWidth) nothrowSets 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) nothrowSets 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) nothrowSets 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 ...void setModel(gtk.tree_model.TreeModel model = null) nothrowSets the model for a [gtk.icon_view.IconView]. 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) nothrowSets the column with pixbufs for icon_view to be column. The pixbuf column must be of type `GDK_TYPE_PIXBUF`void setReorderable(bool reorderable) nothrowThis function is a convenience function to allow you to reorder models that support the [gtk.tree_drag_source_iface.TreeDragSourceIface] and the [gtk.tree_drag_dest_iface.TreeDragDestIface]. Both [...void setRowSpacing(int rowSpacing) nothrowSets the ::row-spacing property which specifies the space which is inserted between the rows of the icon view.void setSelectionMode(gtk.types.SelectionMode mode) nothrowSets the selection mode of the icon_view.void setSpacing(int spacing) nothrowSets 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) nothrowSets the column with text for icon_view to be column. The text column must be of type `G_TYPE_STRING`.void setTooltipCell(gtk.tooltip.Tooltip tooltip, gtk.tree_path.TreePath path, gtk.cell_renderer.CellRenderer cell = null) nothrowSets 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) nothrowIf you only plan to have simple (text-only) tooltips on full items, you can use this function to have [gtk.icon_view.IconView] handle these automatically for you. column should be set to the column...void setTooltipItem(gtk.tooltip.Tooltip tooltip, gtk.tree_path.TreePath path) nothrowSets 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 unsetModelDragDest() nothrowUndoes the effect of [gtk.icon_view.IconView.enableModelDragDest]. Calling this method sets [gtk.icon_view.IconView]:reorderable to false.void unsetModelDragSource() nothrowUndoes the effect of [gtk.icon_view.IconView.enableModelDragSource]. Calling this method sets [gtk.icon_view.IconView]: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) nothrowConnect 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) nothrowConnect 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] == bool)))
&& (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] == bool)))
&& (Parameters!T.length < 5 || (ParameterStorageClassTuple!T[4] == ParameterStorageClass.none && is(Parameters!T[4] : gtk.icon_view.IconView)))
&& Parameters!T.length < 6) nothrowConnect 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) nothrowConnect 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) nothrowConnect 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) nothrowConnect 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) nothrowConnect 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) nothrowConnect to `UnselectAll` signal.Fluent builder implementation template for gtk.icon_view.IconView
T activateOnSingleClick(bool propval) nothrowSet `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) nothrowSet `cellArea` property. Params: propval = The [gtk.cell_area.CellArea] used to layout cell renderers for this view.T columnSpacing(int propval) nothrowSet `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) nothrowSet `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) nothrowSet `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) nothrowSet `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) nothrowSet `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 markupColumn(int propval) nothrowSet `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) nothrowT pixbufColumn(int propval) nothrowSet `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) nothrowSet `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) nothrowSet `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) nothrowSet `selectionMode` property. Params: propval = The ::selection-mode property specifies the selection mode of icon view. If the mode is [gtk.types.SelectionMode.Multiple], rubberband selection is e...T spacing(int propval) nothrowSet `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) nothrowSet `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 `G_TYPE_STR...T tooltipColumn(int propval) nothrowFluent builder for gtk.icon_view.IconView