activate-cursor-item A keybinding signal which gets emitted when the user activates the currently focused item.
item-activated The ::item-activated signal is emitted when the method Gtk.IconView.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.
move-cursor The ::move-cursor signal is a keybinding signal which gets emitted when the user initiates a cursor movement.
select-all A keybinding signal which gets emitted when the user selects all items.
select-cursor-item A keybinding signal which gets emitted when the user selects the item that is currently focused.
selection-changed The ::selection-changed signal is emitted when the selection (i.e.
toggle-cursor-item A keybinding signal which gets emitted when the user toggles whether the currently focused item is selected or not.
unselect-all A keybinding signal which gets emitted when the user unselects all items.
Gtk.IconView provides an alternative view on a Gtk.TreeModel. It displays the model as a grid of icons with labels. Like Gtk.TreeView, it allows to select one or multiple items (depending on the selection mode, see Gtk.IconView.set_selection_mode()). In addition to selection with the arrow keys, Gtk.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.IconView will only display the first level of the tree and ignore the tree’s branches.
Gtk.IconView has a single CSS node with name iconview and style class .view. For rubberband selection, a subnode with name rubberband is used.
Creates a new Gtk.IconView widget using the specified area to layout cells inside the icons.
model (Gtk.TreeModel) – The model.
A newly created Gtk.IconView widget.
Creates a new Gtk.IconView widget with the model model .
Converts widget coordinates to coordinates for the bin_window, as expected by e.g. Gtk.IconView.get_path_at_pos().
a newly-allocated surface of the drag icon.
Creates a cairo.Surface representation of the item at path . This image is used for a drag icon.
Turns self into a drop destination for automatic DND. Calling this method sets Gtk.IconView :reorderable to False.
Turns self into a drag source for automatic DND. Calling this method sets Gtk.IconView :reorderable to False.
Gets the setting set by Gtk.IconView.set_activate_on_single_click().
Fills the bounding rectangle in widget coordinates for the cell specified by path and cell . If cell is None the main cell area is used.
This function is only valid if self is realized.
Returns the value of the ::column-spacing property.
Returns the value of the ::columns property.
True if the cursor is set.
Fills in path and cell with the current cursor path and cell. If the cursor isn’t currently set, then path will be None. If no cell currently has focus, then cell will be None.
The returned Gtk.TreePath must be freed with Gtk.TreePath.free().
Determines the destination item for a given position.
Return location for the path of the highlighted item, or None.
Gets information about the item that is highlighted for feedback.
Finds the path at the point ( x , y ), relative to bin_window coordinates. In contrast to Gtk.IconView.get_path_at_pos(), this function also obtains the cell at the specified position. The returned path should be freed with Gtk.TreePath.free(). See Gtk.IconView.convert_widget_to_bin_window_coords() for converting widget coordinates to bin_window coordinates.
Gets the column in which the item path is currently displayed. Column numbers start at 0.
Returns the value of the ::item-orientation property which determines whether the labels are drawn beside the icons instead of below.
Returns the value of the ::item-padding property.
Gets the row in which the item path is currently displayed. Row numbers start at 0.
Returns the value of the ::item-width property.
Returns the value of the ::margin property.
the markup column, or -1 if it’s unset.
Returns the column with markup text for self .
A Gtk.TreeModel, or None if none is currently being used.
Returns the model the Gtk.IconView is based on. Returns None if the model is unset.
The Gtk.TreePath corresponding to the icon or None if no icon exists at that position.
Finds the path at the point ( x , y ), relative to bin_window coordinates. See Gtk.IconView.get_item_at_pos(), if you are also interested in the cell at the specified position. See Gtk.IconView.convert_widget_to_bin_window_coords() for converting widget coordinates to bin_window coordinates.
the pixbuf column, or -1 if it’s unset.
Returns the column with pixbufs for self .
True if the list can be reordered.
Retrieves whether the user can reorder the list via drag-and-drop. See Gtk.IconView.set_reorderable().
Returns the value of the ::row-spacing property.
A GLib.List containing a Gtk.TreePath for each selected row.
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 Gtk.TreeRowReferences. To do this, you can use Gtk.TreeRowReference.new().
Gets the selection mode of the self .
Returns the value of the ::spacing property.
the text column, or -1 if it’s unset.
Returns the column with text for self .
the index of the tooltip column that is currently being used, or -1 if this is disabled.
Returns the column of self ’s model which is being used for displaying tooltips on self ’s rows.
This function is supposed to be used in a Gtk.Widget ::query-tooltip signal handler for Gtk.IconView. The x , y and keyboard_tip values which are received in the signal handler, should be passed to this function without modification.
The return value indicates whether there is an icon view item at the given coordinates (True) or not (False) for mouse tooltips. For keyboard tooltips the item returned will be the cursor item. When True, then any of model , path and iter which have been provided will be set to point to that row and the corresponding model. x and y will always be converted to be relative to self ’s bin_window if keyboard_tooltip is False.
Sets start_path and end_path to be the first and last visible path. Note that there may be invisible paths in between.
Both paths should be freed with Gtk.TreePath.free() after use.
Activates the item determined by path .
path (Gtk.TreePath) – A Gtk.TreePath to check selection on.
True if 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.
path (Gtk.TreePath) – The path of the item to move to.
use_align (bool) – whether to use alignment arguments, or False.
row_align (float) – The vertical alignment of the item specified by path .
col_align (float) – The horizontal alignment of the item specified by path .
Moves the alignments of self 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.
If use_align is False, then the alignment arguments are ignored, and the tree does the minimum amount of work to scroll the item onto the screen. This means that the item will be scrolled to the edge closest to its current position. If the item is currently visible on the screen, nothing is done.
This function only works if the model is set, and path is a valid row on the model. If the model changes before the self is realized, the centered path will be modified to reflect this change.
Selects all the icons. self must has its selection mode set to Gtk.SelectionMode.MULTIPLE.
path (Gtk.TreePath) – The Gtk.TreePath to be selected.
Selects the row at path .
func (Gtk.IconViewForeachFunc) – The function to call for each selected icon.
data (object or None) – User data to pass to the function.
Calls a function for each selected icon. Note that the model or selection cannot be modified from within this function.
Causes the Gtk.IconView ::item-activated signal to be emitted on a single click instead of a double click.
Sets the ::column-spacing property which specifies the space which is inserted between the columns of the icon view.
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.
start_editing (bool) – True if the specified cell should start being edited.
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 None, 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.
This function is often followed by gtk_widget_grab_focus (icon_view) in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.
path (Gtk.TreePath or None) – The path of the item to highlight, or None.
Sets the item that is highlighted for feedback.
Sets the ::item-orientation property which determines whether the labels are drawn beside the icons instead of below.
Sets the Gtk.IconView :item-padding property which specifies the padding around each of the icon view’s items.
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.
Sets the ::margin property which specifies the space which is inserted at the top, bottom, left and right of the icon view.
Sets the column with markup information for self to be column . The markup column must be of type GObject.TYPE_STRING. If the markup column is set to something, it overrides the text column set by Gtk.IconView.set_text_column().
model (Gtk.TreeModel or None) – The model.
Sets the model for a Gtk.IconView. If the self already has a model set, it will remove it before setting the new model. If model is None, then it will unset the old model.
reorderable (bool) – True, if the list of items can be reordered.
This function is a convenience function to allow you to reorder models that support the Gtk.TreeDragSourceIface and the Gtk.TreeDragDestIface. Both Gtk.TreeStore and Gtk.ListStore 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.
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.
Sets the ::row-spacing property which specifies the space which is inserted between the rows of the icon view.
Sets the selection mode of the self .
Sets the ::spacing property which specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
Sets the column with text for self to be column . The text column must be of type GObject.TYPE_STRING.
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().
See also Gtk.IconView.set_tooltip_column() for a simpler alternative.
If you only plan to have simple (text-only) tooltips on full items, you can use this function to have Gtk.IconView handle these automatically for you. column should be set to the column in self ’s model containing the tooltip texts, or -1 to disable this feature.
When enabled, Gtk.Widget :has-tooltip will be set to True and self will connect a Gtk.Widget ::query-tooltip signal handler.
Note that the signal handler sets the text with Gtk.Tooltip.set_markup(), so &, <, etc have to be escaped in the text.
Sets the tip area of tooltip to be the area covered by the item at path . See also Gtk.IconView.set_tooltip_column() for a simpler alternative. See also Gtk.Tooltip.set_tip_area().
path (Gtk.TreePath) – The Gtk.TreePath to be unselected.
Unselects the row at path .
Undoes the effect of Gtk.IconView.enable_model_drag_dest(). Calling this method sets Gtk.IconView :reorderable to False.
Undoes the effect of Gtk.IconView.enable_model_drag_source(). Calling this method sets Gtk.IconView :reorderable to False.
Selects all the icons. icon_view must has its selection mode set to Gtk.SelectionMode.MULTIPLE.
A keybinding signal which gets emitted when the user activates the currently focused item.
Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control activation programmatically.
The default bindings for this signal are Space, Return and Enter.
The ::item-activated signal is emitted when the method Gtk.IconView.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.
The ::move-cursor signal is a keybinding signal which gets emitted when the user initiates a cursor movement.
PageUp/PageDown which move by “pages” All of these will extend the selection when combined with the Shift modifier.
A keybinding signal which gets emitted when the user selects all items.
Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control selection programmatically.
The default binding for this signal is Ctrl-a.
A keybinding signal which gets emitted when the user selects the item that is currently focused.
There is no default binding for this signal.
The ::selection-changed signal is emitted when the selection (i.e. the set of selected items) changes.
A keybinding signal 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.
There is no default binding for this signal is Ctrl-Space.
A keybinding signal which gets emitted when the user unselects all items.
The default binding for this signal is Ctrl-Shift-a.
The activate-on-single-click property specifies whether the “item-activated” signal will be emitted after a single click.
The Gtk.CellArea used to layout cell renderers for this view.
If no area is specified when creating the icon view with Gtk.IconView.new_with_area() a Gtk.CellAreaBox will be used.
The column-spacing property specifies the space which is inserted between the columns of the icon view.
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.
The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.
The item-padding property specifies the padding around each of the icon view’s item.
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.
The ::markup-column property contains the number of the model column containing markup information to be displayed. The markup column must be of type GObject.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.
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.
The reorderable property specifies if the items can be reordered by DND.
The row-spacing property specifies the space which is inserted between the rows of the icon view.
The ::selection-mode property specifies the selection mode of icon view. If the mode is Gtk.SelectionMode.MULTIPLE, rubberband selection is enabled, for the other modes, only keyboard selection is possible.
The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type GObject.TYPE_STRING. If this property and the :markup-column property are both set to -1, no texts are displayed.