The
gtk:icon-view widget provides an alternative view on a
gtk:tree-model object.
It displays the model as a grid of icons with labels. Like the
gtk:tree-view widget, it allows to select one or multiple items, depending on the selection mode, see the
gtk:icon-view-selection-mode
function. In addition to selection with the arrow keys, the
gtk:icon-view class supports rubberband selection, which is controlled
by dragging the pointer.
Figure: GtkIconView
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, the
gtk:icon-view
widget will only display the first level of the tree and ignore the tree's
branches.
CSS nodes
The
gtk:icon-view implementation has a single CSS node with name
iconview and
.view style class. For rubberband selection, a subnode with name
rubberband is used.
Warning
The
gtk:icon-view implementation is deprecated since 4.10. Use the
gtk:grid-view implementation instead.
Signal Details
The "activate-cursor-item" signal
lambda (view) :action
- view
- The gtk:icon-view widget on which the signal is emitted.
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 the
g:signal-emit function if they need to control
activation programmatically. The default bindings for this signal are the
Space,
Return and
Enter keys.
The "item-activated" signal
lambda (view path) :run-last
- view
- The gtk:icon-view widget on which the signal is emitted.
- path
- The gtk:tree-path instance for the activated item.
The signal is emitted when the
gtk:icon-view-item-activated function
is called or the user double clicks an item. It is also emitted when a non-editable item is selected and one of the
Space,
Return or
Enter keys is pressed.
The "move-cursor" signal
lambda (view step count extent modify) :action
- view
- The gtk:icon-view widget which received the signal.
- step
- The granularity of the move, as a value of the gtk:movement-step enumeration.
- count
- The integer with the number of step units to move.
- extend
- The boolean whether to extend the selection.
- modify
- The boolean whether to modify the selection.
The signal is a keybinding signal which gets emitted when the user
initiates a cursor movement. Applications should not connect to it, but may emit it with the
g:signal-emit function if they need to control
the cursor programmatically. The default bindings for this signal include
- Arrow keys which move by individual steps.
- Home/End keys which move to the first/last item.
- PageUp/PageDown which move by "pages".
All of these will extend the selection when combined with the
Shift
modifier.
The "select-all" signal
lambda (view) :action
- view
- The gtk:icon-view widget on which the signal is emitted.
A keybinding signal which gets emitted when the user selects all items.
Applications should not connect to it, but may emit it with the
g:signal-emit function if they need to control selection programmatically. The default binding for this signal is the
Ctrl-a
key.
The "select-cursor-item" signal
lambda (view) :action
- view
- The gtk:icon-view widget on which the signal is emitted.
A keybinding signal which gets emitted when the user selects the item that
is currently focused. Applications should not connect to it, but may emit it with the
g:signal-emit function if they need to control selection
programmatically. There is no default binding for this signal.
The "selection-changed" signal
lambda (view) :run-first
- view
- The gtk:icon-view widget on which the signal is emitted.
The signal is emitted when the selection changes, that is the set of
selected items.
The "toggle-cursor-item" signal
lambda (view) :action
- view
- The gtk:icon-view widget on which the signal is emitted.
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. Applications should not connect to it, but may emit it with the
g:signal-emit function if they need to control selection
programmatically. The default binding for this signal is the
Ctrl-Space key.
The "unselect-all" signal
lambda (view) :action
- view
- The gtk:icon-view widget on which the signal is emitted.
A keybinding signal which gets emitted when the user unselects all items.
Applications should not connect to it, but may emit it with the
g:signal-emit function if they need to control selection
programmatically. The default binding for this signal is the
Ctrl-Shift-a key.