Package ch.bailu.gtk.gtk
Class IconView
- All Implemented Interfaces:
PointerInterface
`GtkIconView` is a widget which displays data in a grid of icons.
`GtkIconView` provides an alternative view on a `GtkTreeModel`.
It displays the model as a grid of icons with labels. Like
[class@Gtk.TreeView], it allows to select one or multiple items
(depending on the selection mode, see [method@Gtk.IconView.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.
`GtkIconView` provides an alternative view on a `GtkTreeModel`.
It displays the model as a grid of icons with labels. Like
[class@Gtk.TreeView], it allows to select one or multiple items
(depending on the selection mode, see [method@Gtk.IconView.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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
Nested classes/interfaces inherited from class ch.bailu.gtk.gtk.Widget
Widget.OnDestroy, Widget.OnDestroyNotify, Widget.OnDirectionChanged, Widget.OnHide, Widget.OnKeynavFailed, Widget.OnMap, Widget.OnMnemonicActivate, Widget.OnMoveFocus, Widget.OnQueryTooltip, Widget.OnRealize, Widget.OnShow, Widget.OnStateFlagsChanged, Widget.OnTickCallback, Widget.OnUnmap, Widget.OnUnrealize
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class ch.bailu.gtk.gtk.Widget
SIGNAL_ON_DESTROY, SIGNAL_ON_DIRECTION_CHANGED, SIGNAL_ON_HIDE, SIGNAL_ON_KEYNAV_FAILED, SIGNAL_ON_MAP, SIGNAL_ON_MNEMONIC_ACTIVATE, SIGNAL_ON_MOVE_FOCUS, SIGNAL_ON_QUERY_TOOLTIP, SIGNAL_ON_REALIZE, SIGNAL_ON_SHOW, SIGNAL_ON_STATE_FLAGS_CHANGED, SIGNAL_ON_UNMAP, SIGNAL_ON_UNREALIZE
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionIconView()
Creates a new `GtkIconView` widgetIconView
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceAccessible
.Implements interfaceBuildable
.Implements interfaceCellLayout
.Implements interfaceConstraintTarget
.Implements interfaceScrollable
.createDragIcon
(TreePath path) Creates a `GdkPaintable` representation of the item at @path.void
enableModelDragDest
(ContentFormats formats, int actions) Turns @icon_view into a drop destination for automatic DND.void
enableModelDragSource
(int start_button_mask, ContentFormats formats, int actions) Turns @icon_view into a drag source for automatic DND.boolean
Gets the setting set by gtk_icon_view_set_activate_on_single_click().boolean
getCellRect
(TreePath path, CellRenderer cell, Rectangle rect) Fills the bounding rectangle in widget coordinates for the cell specified by
@path and @cell.static ClassHandler
int
Returns the value of the ::columns property.int
Returns the value of the ::column-spacing property.static int
int
getItemColumn
(TreePath path) Gets the column in which the item @path is currently
displayed.int
Returns the value of the ::item-orientation property which determines
whether the labels are drawn beside the icons instead of below.int
Returns the value of the ::item-padding property.int
getItemRow
(TreePath path) Gets the row in which the item @path is currently
displayed.int
Returns the value of the ::item-width property.int
Returns the value of the ::margin property.int
Returns the column with markup text for @icon_view.getModel()
Returns the model the `GtkIconView` is based on.static long
static TypeSystem.TypeSize
getPathAtPos
(int x, int y) Gets the path for the icon at the given position.int
Returns the column with pixbufs for @icon_view.boolean
Retrieves whether the user can reorder the list via drag-and-drop.int
Returns the value of the ::row-spacing property.Creates a list of paths of all selected items.int
Gets the selection mode of the @icon_view.int
Returns the value of the ::spacing property.int
Returns the column with text for @icon_view.int
Returns the column of @icon_view’s model which is being used for
displaying tooltips on @icon_view’s rows.static long
static TypeSystem.TypeSize
void
itemActivated
(TreePath path) Activates the item determined by @path.static IconView
newWithAreaIconView
(CellArea area) Creates a new `GtkIconView` widget using the
specified @area to layout cells inside the icons.static IconView
newWithModelIconView
(TreeModel model) Creates a new `GtkIconView` widget with the model @model.Connect to signal "activate-cursor-item".Connect to signal "item-activated".onMoveCursor
(IconView.OnMoveCursor signal) Connect to signal "move-cursor".onSelectAll
(IconView.OnSelectAll signal) Connect to signal "select-all".Connect to signal "select-cursor-item".Connect to signal "selection-changed".Connect to signal "toggle-cursor-item".onUnselectAll
(IconView.OnUnselectAll signal) Connect to signal "unselect-all".boolean
pathIsSelected
(TreePath path) Returns %TRUE if the icon pointed to by @path is currently
selected.void
scrollToPath
(TreePath path, boolean use_align, float row_align, float col_align) Moves the alignments of @icon_view to the position specified by @path.void
Selects all the icons.void
selectedForeach
(IconView.OnIconViewForeachFunc func, Pointer data) Calls a function for each selected icon.void
selectPath
(TreePath path) Selects the row at @path.void
setActivateOnSingleClick
(boolean single) Causes the `GtkIconView`::item-activated signal to be emitted on
a single click instead of a double click.void
setColumns
(int columns) Sets the ::columns property which determines in how
many columns the icons are arranged.void
setColumnSpacing
(int column_spacing) Sets the ::column-spacing property which specifies the space
which is inserted between the columns of the icon view.void
setCursor
(TreePath path, CellRenderer cell, boolean start_editing) Sets the current keyboard focus to be at @path, and selects it.void
setDragDestItem
(TreePath path, int pos) Sets the item that is highlighted for feedback.void
setItemOrientation
(int orientation) Sets the ::item-orientation property which determines whether the labels
are drawn beside the icons instead of below.void
setItemPadding
(int item_padding) Sets the `GtkIconView`:item-padding property which specifies the padding
around each of the icon view’s items.void
setItemWidth
(int item_width) Sets the ::item-width property which specifies the width
to use for each item.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 @icon_view to be
@column.void
Sets the model for a `GtkIconView`.void
setPixbufColumn
(int column) Sets the column with pixbufs for @icon_view to be @column.void
setReorderable
(boolean reorderable) This function is a convenience function to allow you to reorder models that
support the `GtkTreeDragSourceIface` and the `GtkTreeDragDestIface`.void
setRowSpacing
(int row_spacing) Sets the ::row-spacing property which specifies the space
which is inserted between the rows of the icon view.void
setSelectionMode
(int 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 @icon_view to be @column.void
setTooltipCell
(Tooltip tooltip, TreePath path, CellRenderer cell) Sets the tip area of @tooltip to the area which @cell occupies in
the item pointed to by @path.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.void
setTooltipItem
(Tooltip tooltip, TreePath path) Sets the tip area of @tooltip to be the area covered by the item at @path.void
Unselects all the icons.void
unselectPath
(TreePath path) Unselects the row at @path.void
Undoes the effect of gtk_icon_view_enable_model_drag_dest().void
Undoes the effect of gtk_icon_view_enable_model_drag_source().Methods inherited from class ch.bailu.gtk.gtk.Widget
actionSetEnabled, actionSetEnabled, activate, activateAction, activateAction, activateActionVariant, activateActionVariant, activateDefault, addController, addCssClass, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeCssClass, removeMnemonicLabel, removeTickCallback, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipMarkup, setTooltipText, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, snapshotChild, triggerTooltipQuery, unmap, unparent, unrealize, unsetStateFlags
Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_ACTIVATE_CURSOR_ITEM
- See Also:
-
SIGNAL_ON_ITEM_ACTIVATED
- See Also:
-
SIGNAL_ON_MOVE_CURSOR
- See Also:
-
SIGNAL_ON_SELECT_ALL
- See Also:
-
SIGNAL_ON_SELECT_CURSOR_ITEM
- See Also:
-
SIGNAL_ON_SELECTION_CHANGED
- See Also:
-
SIGNAL_ON_TOGGLE_CURSOR_ITEM
- See Also:
-
SIGNAL_ON_UNSELECT_ALL
- See Also:
-
-
Constructor Details
-
IconView
-
IconView
public IconView()Creates a new `GtkIconView` widget
-
-
Method Details
-
getClassHandler
-
newWithAreaIconView
Creates a new `GtkIconView` widget using the
specified @area to layout cells inside the icons.- Parameters:
area
- the `GtkCellArea` to use to layout cells- Returns:
- A newly created `GtkIconView` widget
-
newWithModelIconView
Creates a new `GtkIconView` widget with the model @model.- Parameters:
model
- The model.- Returns:
- A newly created `GtkIconView` widget.
-
createDragIcon
Creates a `GdkPaintable` representation of the item at @path.
This image is used for a drag icon.- Parameters:
path
- a `GtkTreePath` in @icon_view- Returns:
- a newly-allocated `GdkPaintable` of the drag icon.
-
enableModelDragDest
Turns @icon_view into a drop destination for automatic DND. Calling this
method sets `GtkIconView`:reorderable to %FALSE.- Parameters:
formats
- the formats that the drag will supportactions
- the bitmask of possible actions for a drag to this widget
-
enableModelDragSource
public void enableModelDragSource(int start_button_mask, @Nonnull ContentFormats formats, int actions) Turns @icon_view into a drag source for automatic DND. Calling this
method sets `GtkIconView`:reorderable to %FALSE.- Parameters:
start_button_mask
- Mask of allowed buttons to start dragformats
- the formats that the drag will supportactions
- the bitmask of possible actions for a drag from this widget
-
getActivateOnSingleClick
public boolean getActivateOnSingleClick()Gets the setting set by gtk_icon_view_set_activate_on_single_click().- Returns:
- %TRUE if item-activated will be emitted on a single click
-
getCellRect
public boolean getCellRect(@Nonnull TreePath path, @Nullable CellRenderer cell, @Nonnull 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.
This function is only valid if @icon_view is realized.- Parameters:
path
- a `GtkTreePath`cell
- a `GtkCellRenderer`rect
- rectangle to fill with cell rect- Returns:
- %FALSE if there is no such item, %TRUE otherwise
-
getColumnSpacing
public int getColumnSpacing()Returns the value of the ::column-spacing property.- Returns:
- the space between columns
-
getColumns
public int getColumns()Returns the value of the ::columns property.- Returns:
- the number of columns, or -1
-
getItemColumn
Gets the column in which the item @path is currently
displayed. Column numbers start at 0.- Parameters:
path
- the `GtkTreePath` of the item- Returns:
- The column in which the item is displayed
-
getItemOrientation
public int 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 icons
-
getItemPadding
public int getItemPadding()Returns the value of the ::item-padding property.- Returns:
- the padding around items
-
getItemRow
Gets the row in which the item @path is currently
displayed. Row numbers start at 0.- Parameters:
path
- the `GtkTreePath` of the item- Returns:
- The row in which the item is displayed
-
getItemWidth
public int getItemWidth()Returns the value of the ::item-width property.- Returns:
- the width of a single item, or -1
-
getMargin
public int getMargin()Returns the value of the ::margin property.- Returns:
- the space at the borders
-
getMarkupColumn
public int getMarkupColumn()Returns the column with markup text for @icon_view.- Returns:
- the markup column, or -1 if it’s unset.
-
getModel
Returns the model the `GtkIconView` is based on. Returns %NULL if the
model is unset.- Returns:
- The currently used `GtkTreeModel`
-
getPathAtPos
Gets the path for the icon at the given position.- Parameters:
x
- The x position to be identifiedy
- The y position to be identified- Returns:
- The `GtkTreePath` corresponding to the icon or %NULL if no icon exists at that position.
-
getPixbufColumn
public int getPixbufColumn()Returns the column with pixbufs for @icon_view.- Returns:
- the pixbuf column, or -1 if it’s unset.
-
getReorderable
public boolean getReorderable()Retrieves whether the user can reorder the list via drag-and-drop.
See gtk_icon_view_set_reorderable().- Returns:
- %TRUE if the list can be reordered.
-
getRowSpacing
public int getRowSpacing()Returns the value of the ::row-spacing property.- Returns:
- the space between rows
-
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 `GtkTreeRowReferences`.
To do this, you can use gtk_tree_row_reference_new().
To free the return value, use `g_list_free_full`:<!-- language="C" --> GtkWidget *icon_view = gtk_icon_view_new (); // Use icon_view GList *list = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (icon_view)); // use list g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
- Returns:
- A `GList` containing a `GtkTreePath` for each selected row.
-
getSelectionMode
public int getSelectionMode()Gets the selection mode of the @icon_view.- Returns:
- the current selection mode
-
getSpacing
public int getSpacing()Returns the value of the ::spacing property.- Returns:
- the space between cells
-
getTextColumn
public int getTextColumn()Returns the column with text for @icon_view.- Returns:
- the text column, or -1 if it’s unset.
-
getTooltipColumn
public int getTooltipColumn()Returns 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 disabled.
-
itemActivated
Activates the item determined by @path.- Parameters:
path
- The `GtkTreePath` to be activated
-
pathIsSelected
Returns %TRUE if the icon pointed to by @path is currently
selected. If @path does not point to a valid location, %FALSE is returned.- Parameters:
path
- A `GtkTreePath` to check selection on.- Returns:
- %TRUE if @path is selected.
-
scrollToPath
public void scrollToPath(@Nonnull TreePath path, boolean use_align, float row_align, float col_align) 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.
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 @icon_view is realized, the
centered path will be modified to reflect this change.- Parameters:
path
- The path of the item to move to.use_align
- whether to use alignment arguments, or %FALSE.row_align
- The vertical alignment of the item specified by @path.col_align
- The horizontal alignment of the item specified by @path.
-
selectAll
public void selectAll()Selects all the icons. @icon_view must has its selection mode set
to %GTK_SELECTION_MULTIPLE. -
selectPath
Selects the row at @path.- Parameters:
path
- The `GtkTreePath` to be selected.
-
selectedForeach
Calls a function for each selected icon. Note that the model or
selection cannot be modified from within this function.- Parameters:
func
- The function to call for each selected icon.data
- User data to pass to the function.
-
setActivateOnSingleClick
public void setActivateOnSingleClick(boolean single) Causes the `GtkIconView`::item-activated signal to be emitted on
a single click instead of a double click.- Parameters:
single
- %TRUE to emit item-activated on a single click
-
setColumnSpacing
public void setColumnSpacing(int column_spacing) Sets the ::column-spacing property which specifies the space
which is inserted between the columns of the icon view.- Parameters:
column_spacing
- the column spacing
-
setColumns
public 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.- Parameters:
columns
- the number of columns
-
setCursor
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.
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.- Parameters:
path
- A `GtkTreePath`cell
- One of the cell renderers of @icon_viewstart_editing
- %TRUE if the specified cell should start being edited.
-
setDragDestItem
Sets the item that is highlighted for feedback.- Parameters:
path
- The path of the item to highlightpos
- Specifies where to drop, relative to the item
-
setItemOrientation
public void setItemOrientation(int orientation) Sets the ::item-orientation property which determines whether the labels
are drawn beside the icons instead of below.- Parameters:
orientation
- the relative position of texts and icons
-
setItemPadding
public void setItemPadding(int item_padding) Sets the `GtkIconView`:item-padding property which specifies the padding
around each of the icon view’s items.- Parameters:
item_padding
- the item padding
-
setItemWidth
public void setItemWidth(int 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.- Parameters:
item_width
- the width for each item
-
setMargin
public 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.- Parameters:
margin
- the margin
-
setMarkupColumn
public void setMarkupColumn(int 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().- Parameters:
column
- A column in the currently used model, or -1 to display no text
-
setModel
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.- Parameters:
model
- The model.
-
setPixbufColumn
public void setPixbufColumn(int column) Sets the column with pixbufs for @icon_view to be @column. The pixbuf
column must be of type `GDK_TYPE_PIXBUF`- Parameters:
column
- A column in the currently used model, or -1 to disable
-
setReorderable
public void setReorderable(boolean 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.
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.- Parameters:
reorderable
- %TRUE, if the list of items can be reordered.
-
setRowSpacing
public void setRowSpacing(int row_spacing) Sets the ::row-spacing property which specifies the space
which is inserted between the rows of the icon view.- Parameters:
row_spacing
- the row spacing
-
setSelectionMode
public void setSelectionMode(int mode) Sets the selection mode of the @icon_view.- Parameters:
mode
- The selection mode
-
setSpacing
public 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.- Parameters:
spacing
- the spacing
-
setTextColumn
public void setTextColumn(int column) Sets the column with text for @icon_view to be @column. The text
column must be of type `G_TYPE_STRING`.- Parameters:
column
- A column in the currently used model, or -1 to display no text
-
setTooltipCell
public void setTooltipCell(@Nonnull Tooltip tooltip, @Nonnull TreePath path, @Nullable CellRenderer 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().
See also gtk_icon_view_set_tooltip_column() for a simpler alternative.- Parameters:
tooltip
- a `GtkTooltip`path
- a `GtkTreePath`cell
- a `GtkCellRenderer`
-
setTooltipColumn
public 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_view’s model
containing the tooltip texts, or -1 to disable this feature.
When enabled, `GtkWidget:has-tooltip` will be set to %TRUE and
@icon_view will connect a `GtkWidget::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.- Parameters:
column
- an integer, which is a valid column number for @icon_view’s model
-
setTooltipItem
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().- Parameters:
tooltip
- a `GtkTooltip`path
- a `GtkTreePath`
-
unselectAll
public void unselectAll()Unselects all the icons. -
unselectPath
Unselects the row at @path.- Parameters:
path
- The `GtkTreePath` to be unselected.
-
unsetModelDragDest
public void unsetModelDragDest()Undoes the effect of gtk_icon_view_enable_model_drag_dest(). Calling this
method sets `GtkIconView`:reorderable to %FALSE. -
unsetModelDragSource
public void unsetModelDragSource()Undoes the effect of gtk_icon_view_enable_model_drag_source(). Calling this
method sets `GtkIconView`:reorderable to %FALSE. -
onActivateCursorItem
Connect to signal "activate-cursor-item".
SeeIconView.OnActivateCursorItem.onActivateCursorItem()
for signal description.
FieldSIGNAL_ON_ACTIVATE_CURSOR_ITEM
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onItemActivated
Connect to signal "item-activated".
SeeIconView.OnItemActivated.onItemActivated(ch.bailu.gtk.gtk.TreePath)
for signal description.
FieldSIGNAL_ON_ITEM_ACTIVATED
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onMoveCursor
Connect to signal "move-cursor".
SeeIconView.OnMoveCursor.onMoveCursor(int, int, boolean, boolean)
for signal description.
FieldSIGNAL_ON_MOVE_CURSOR
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onSelectAll
Connect to signal "select-all".
SeeIconView.OnSelectAll.onSelectAll()
for signal description.
FieldSIGNAL_ON_SELECT_ALL
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onSelectCursorItem
Connect to signal "select-cursor-item".
SeeIconView.OnSelectCursorItem.onSelectCursorItem()
for signal description.
FieldSIGNAL_ON_SELECT_CURSOR_ITEM
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onSelectionChanged
Connect to signal "selection-changed".
SeeIconView.OnSelectionChanged.onSelectionChanged()
for signal description.
FieldSIGNAL_ON_SELECTION_CHANGED
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onToggleCursorItem
Connect to signal "toggle-cursor-item".
SeeIconView.OnToggleCursorItem.onToggleCursorItem()
for signal description.
FieldSIGNAL_ON_TOGGLE_CURSOR_ITEM
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onUnselectAll
Connect to signal "unselect-all".
SeeIconView.OnUnselectAll.onUnselectAll()
for signal description.
FieldSIGNAL_ON_UNSELECT_ALL
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
asAccessible
Implements interfaceAccessible
. Call this to get access to interface functions.- Overrides:
asAccessible
in classWidget
- Returns:
Accessible
-
asBuildable
Implements interfaceBuildable
. Call this to get access to interface functions.- Overrides:
asBuildable
in classWidget
- Returns:
Buildable
-
asCellLayout
Implements interfaceCellLayout
. Call this to get access to interface functions.- Returns:
CellLayout
-
asConstraintTarget
Implements interfaceConstraintTarget
. Call this to get access to interface functions.- Overrides:
asConstraintTarget
in classWidget
- Returns:
ConstraintTarget
-
asScrollable
Implements interfaceScrollable
. Call this to get access to interface functions.- Returns:
Scrollable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-