gtkmm: Gtk::IconView Class Reference

# Gtk::IconView Class Reference
[Widgets, Container Widgets]

The IconView provides an alternative view of a list model. More...

Inherits Gtk::Container.

Collaboration diagram for Gtk::IconView:
[legend]

List of all members.

## Public Types

typedef sigc::slot< void, const TreeModel::Path& > | SlotForeach
| For instance, void on_foreach(const Gtk::TreeModel::Path& path);.
typedef Glib::ListHandle < TreePath, TreePathTraits > | ArrayHandle_TreePaths

## Public Member Functions

virtual | ~IconView ()
GtkIconView* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkIconView* | gobj () const
| Provides access to the underlying C GtkObject.
| IconView ()
| IconView (const Glib::RefPtr< TreeModel >& model)
void | set_model (const Glib::RefPtr< TreeModel >& model)
| Sets the model for a Gtk::IconView.
Glib::RefPtr< TreeModel > | get_model ()
| Returns the model the Gtk::IconView is based on.
Glib::RefPtr< const TreeModel > | get_model () const
| Returns the model the Gtk::IconView is based on.
void | unset_model ()
| Remove the model from the IconView.
void | set_text_column (int column)
| Sets the column with text for icon_view to be column.
void | set_text_column (const TreeModelColumnBase& model_column)
| Sets the column with text for icon_view to be column.
int | get_text_column () const
| Returns the column with text for icon_view.
void | set_markup_column (int column)
| Sets the column with markup information for icon_view to be column.
void | set_markup_column (const TreeModelColumnBase& column)
| Sets the column with markup information for icon_view to be column.
int | get_markup_column () const
| Returns the column with markup text for icon_view.
void | set_pixbuf_column (int column)
| Sets the column with pixbufs for icon_view to be column.
void | set_pixbuf_column (const TreeModelColumnBase& column)
| Sets the column with pixbufs for icon_view to be column.
int | get_pixbuf_column () const
| Returns the column with pixbufs for icon_view.
void | set_orientation (Orientation orientation)
| Sets the orientation property which determines whether the labels are drawn beside the icons instead of below.
Orientation | get_orientation () const
| Returns the value of the orientation property which determines whether the labels are drawn beside the icons instead of below.
void | set_columns (int columns)
| Sets the columns property which determines in how many columns the icons are arranged.
int | get_columns () const
| Returns the value of the columns property.
void | set_item_width (int item_width)
| Sets the item-width property which specifies the width to use for each item.
int | get_icon_width () const
| Returns the value of the item-width property.
void | set_spacing (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.
int | get_spacing () const
| Returns the value of the spacing property.
void | set_row_spacing (int row_spacing)
| Sets the row-spacing property which specifies the space which is inserted between the rows of the icon view.
gint | get_row_spacing () const
| Returns the value of the row-spacing property.
void | set_column_spacing (int column_spacing)
| Sets the column-spacing property which specifies the space which is inserted between the columns of the icon view.
int | get_column_spacing () const
| Returns the value of the column-spacing property.
void | set_margin (int margin)
| Sets the margin property which specifies the space which is inserted at the top, bottom, left and right of the icon view.
int | get_margin () const
| Returns the value of the margin property.
TreeModel::Path | get_path_at_pos (int x, int y) const
| Finds the path at the point ( x, y), relative to bin_window coordinates.
bool | get_item_at_pos (int x, int y, TreeModel::Path& path, CellRenderer*& cell) const
| Finds the path at the point (x, y), relative to widget coordinates.
bool | get_item_at_pos (int x, int y, TreeModel::Path& path) const
| Finds the path at the point (x, y), relative to widget coordinates.
bool | get_item_at_pos (int x, int y, CellRenderer*& cell) const
| Finds the path at the point (x, y), relative to widget coordinates.
bool | get_visible_range (TreeModel::Path& start_path, TreeModel::Path& end_path) const
void | selected_foreach (const SlotForeach& slot)
| Calls a function for each selected icon.
void | set_selection_mode (SelectionMode mode)
| Sets the selection mode of the icon_view.
SelectionMode | get_selection_mode () const
| Gets the selection mode of the icon_view.
void | select_path (const TreeModel::Path& path)
| Selects the row at path.
void | unselect_path (const TreeModel::Path& path)
| Unselects the row at path.
bool | path_is_selected (const TreeModel::Path& path) const
| Returns `true` if the icon pointed to by path is currently selected.
ArrayHandle_TreePaths | get_selected_items () const
| Creates a list of paths of all selected items.
void | select_all ()
| Selects all the icons.
void | unselect_all ()
| Unselects all the icons.
void | item_activated (const TreeModel::Path& path)
| Activates the item determined by path.
void | set_cursor (const TreeModel::Path& path, CellRenderer& cell, bool start_editing)
| Sets the current keyboard focus to be at path, and selects it.
bool | get_cursor (TreeModel::Path& path, CellRenderer*& cell) const
| Fills in path and cell with the current cursor path and cell.
bool | get_cursor (TreeModel::Path& path) const
| Fills in path and cell with the current cursor path and cell.
bool | get_cursor (CellRenderer*& cell) const
| Fills in path and cell with the current cursor path and cell.
void | scroll_to_path (const TreeModel::Path& path, bool use_align, gfloat row_align, gfloat col_align)
| Moves the alignments of icon_view to the position specified by path.
void | enable_model_drag_source (const ArrayHandle_TargetEntry& targets, Gdk::ModifierType start_button_mask=Gdk::MODIFIER_MASK, Gdk::DragAction actions=Gdk::ACTION_COPY|Gdk::ACTION_MOVE)
| Turns the IconView into a drag source for automatic DND.
void | enable_model_drag_dest (const ArrayHandle_TargetEntry& targets, Gdk::DragAction actions=Gdk::ACTION_COPY|Gdk::ACTION_MOVE)
| Turns the IconView into a drop destination for automatic DND.
void | unset_model_drag_source ()
| Undoes the effect of enable_model_drag_source().
void | unset_model_drag_dest ()
| Undoes the effect of enable_model_drag_dest().
void | set_reorderable (bool reorderable=true)
| This function is a convenience function to allow you to reorder models that support the Gtk::TreeDragSourceIface and the Gtk::TreeDragDestIface.
bool | get_reorderable () const
| Retrieves whether the user can reorder the list via drag-and-drop.
void | set_drag_dest_item (const TreeModel::Path& path, IconViewDropPosition pos)
| Sets the item that is highlighted for feedback.
void | get_drag_dest_item (TreeModel::Path& path, IconViewDropPosition& pos) const
| Gets information about the item that is highlighted for feedback.
void | get_drag_dest_item (TreeModel::Path& path) const
| Gets information about the item that is highlighted for feedback.
void | get_drag_dest_item (IconViewDropPosition& pos) const
| Gets information about the item that is highlighted for feedback.
bool | get_dest_item_at_pos (int drag_x, int drag_y, TreeModel::Path& path, IconViewDropPosition& pos) const
| Determines the destination item for a given position.
bool | get_dest_item_at_pos (int drag_x, int drag_y, TreeModel::Path& path) const
| Determines the destination item for a given position.
bool | get_dest_item_at_pos (int drag_x, int drag_y, IconViewDropPosition& pos) const
| Determines the destination item for a given position.
Glib::RefPtr< Gdk::Pixmap > | create_drag_icon (const TreeModel::Path& path)
| Creates a Gdk::Pixmap representation of the item at path.
void | convert_widget_to_bin_window_coords (int wx, int wy, int& bx, int& by) const
| Converts widget coordinates to coordinates for the bin_window, as expected by e.g. get_path_at_pos().
void | set_tooltip_item (const Glib::RefPtr< Tooltip >& tooltip, const TreeModel::Path& path)
| Sets the tip area of tooltip to be the area covered by the item at path.
void | set_tooltip_cell (const Glib::RefPtr< Tooltip >& tooltip, const TreeModel::Path& path, CellRenderer& cell)
| Sets the tip area of tooltip to the area which cell occupies in the item pointed to by path.
void | set_tooltip_cell (const Glib::RefPtr< Tooltip >& tooltip, const TreeModel::Path& path)
| Sets the tip area of tooltip to the area occupied by the item pointed to by path.
bool | get_tooltip_context_path (int& x, int& y, bool keyboard_tip, TreeModel::Path& path)
bool | get_tooltip_context_iter (int& x, int& y, bool keyboard_tip, Gtk::TreeModel::iterator& iter)
void | set_tooltip_column (int column)
| 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.
int | get_tooltip_column () const
| Returns the column of icon_view's model which is being used for displaying tooltips on icon_view's rows.
Glib::SignalProxy2< void, Adjustment*, Adjustment* > | signal_set_scroll_adjustments ()
Glib::SignalProxy1< void, const TreeModel::Path& > | signal_item_activated ()
Glib::SignalProxy0< void > | signal_selection_changed ()
Glib::PropertyProxy< int > | property_pixbuf_column ()
| Model column used to retrieve the icon pixbuf from.
Glib::PropertyProxy_ReadOnly< int > | property_pixbuf_column () const
| Model column used to retrieve the icon pixbuf from.
Glib::PropertyProxy< int > | property_text_column ()
| Model column used to retrieve the text from.
Glib::PropertyProxy_ReadOnly< int > | property_text_column () const
| Model column used to retrieve the text from.
Glib::PropertyProxy< int > | property_markup_column ()
| Model column used to retrieve the text if using Pango markup.
Glib::PropertyProxy_ReadOnly< int > | property_markup_column () const
| Model column used to retrieve the text if using Pango markup.
Glib::PropertyProxy < SelectionMode > | property_selection_mode ()
| The selection mode.
Glib::PropertyProxy_ReadOnly < SelectionMode > | property_selection_mode () const
| The selection mode.
Glib::PropertyProxy< Orientation > | property_orientation ()
| How the text and icon of each item are positioned relative to each other.
Glib::PropertyProxy_ReadOnly < Orientation > | property_orientation () const
| How the text and icon of each item are positioned relative to each other.
Glib::PropertyProxy < Glib::RefPtr< TreeModel > > | property_model ()
| The model for the icon view.
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< TreeModel > > | property_model () const
| The model for the icon view.
Glib::PropertyProxy< int > | property_columns ()
| Number of columns to display.
Glib::PropertyProxy_ReadOnly< int > | property_columns () const
| Number of columns to display.
Glib::PropertyProxy< int > | property_item_width ()
| The width used for each item.
Glib::PropertyProxy_ReadOnly< int > | property_item_width () const
| The width used for each item.
Glib::PropertyProxy< int > | property_spacing ()
| Space which is inserted between cells of an item.
Glib::PropertyProxy_ReadOnly< int > | property_spacing () const
| Space which is inserted between cells of an item.
Glib::PropertyProxy< int > | property_row_spacing ()
| Space which is inserted between grid rows.
Glib::PropertyProxy_ReadOnly< int > | property_row_spacing () const
| Space which is inserted between grid rows.
Glib::PropertyProxy< int > | property_column_spacing ()
| Space which is inserted between grid columns.
Glib::PropertyProxy_ReadOnly< int > | property_column_spacing () const
| Space which is inserted between grid columns.
Glib::PropertyProxy< int > | property_margin ()
| Space which is inserted at the edges of the icon view.
Glib::PropertyProxy_ReadOnly< int > | property_margin () const
| Space which is inserted at the edges of the icon view.

## Protected Member Functions

virtual void | on_set_scroll_adjustments (Adjustment* hadjustment, Adjustment* vadjustment)
virtual void | on_item_activated (const TreeModel::Path& path)
virtual void | on_selection_changed ()

## Related Functions

(Note that these are not member functions.)
Gtk::IconView* | wrap (GtkIconView* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

The IconView provides an alternative view of a list model.

It displays the model as a grid of icons with labels. Like the TreeView, it allows the user to select one or multiple items (depending on the selection mode - see set_selection_mode()). In addition to selection with the arrow keys, the IconView supports rubberband selection, by dragging the pointer.

## Member Typedef Documentation

typedef Glib::ListHandle<TreePath, TreePathTraits> Gtk::IconView::ArrayHandle_TreePaths

typedef sigc::slot<void, const TreeModel::Path&> Gtk::IconView::SlotForeach

For instance, void on_foreach(const Gtk::TreeModel::Path& path);.

## Constructor & Destructor Documentation

virtual Gtk::IconView::~IconView | ( |  | ) | `[virtual]`

Gtk::IconView::IconView | ( |  | ) |

Gtk::IconView::IconView | ( | const Glib::RefPtr< TreeModel >& | model | ) | `[explicit]`

## Member Function Documentation

void Gtk::IconView::convert_widget_to_bin_window_coords | ( | int | wx,
|  | int | wy,
|  | int & | bx,
|  | int & | by |
| ) |  |  | const

Converts widget coordinates to coordinates for the bin_window, as expected by e.g. get_path_at_pos().

Since gtkmm 2.12:

Parameters:

  | wx | X coordinate relative to the widget.
  | wy | Y coordinate relative to the widget.
  | bx | Return location for bin_window X coordinate.
  | by | Return location for bin_window Y coordinate.

Glib::RefPtr<Gdk::Pixmap> Gtk::IconView::create_drag_icon | ( | const TreeModel::Path& | path | ) |

Creates a Gdk::Pixmap representation of the item at path.

This image is used for a drag icon.

Since gtkmm 2.8:

Parameters:

  | path | A Gtk::TreePath in icon_view.

Returns:
  A newly-allocated pixmap of the drag icon.

void Gtk::IconView::enable_model_drag_dest | ( | const ArrayHandle_TargetEntry & | targets,
|  | Gdk::DragAction | actions = `Gdk::ACTION_COPY|Gdk::ACTION_MOVE` |
| ) |  |  |

Turns the IconView into a drop destination for automatic DND.

Parameters:

  | targets | The table of targets that the drag will support.
  | actions | The bitmask of possible actions for a drag from this widget.

void Gtk::IconView::enable_model_drag_source | ( | const ArrayHandle_TargetEntry & | targets,
|  | Gdk::ModifierType | start_button_mask = `Gdk::MODIFIER_MASK`,
|  | Gdk::DragAction | actions = `Gdk::ACTION_COPY|Gdk::ACTION_MOVE` |
| ) |  |  |

Turns the IconView into a drag source for automatic DND.

Parameters:

  | targets | Standard container of targets that the drag will support.
  | start_button_mask | Mask of allowed buttons to start drag.
  | actions | The bitmask of possible actions for a drag from this widget.

int Gtk::IconView::get_column_spacing | ( |  | ) | const

Returns the value of the column-spacing property.

Since gtkmm 2.6:

Returns:
  The space between columns.

int Gtk::IconView::get_columns | ( |  | ) | const

Returns the value of the columns property.

Since gtkmm 2.6:

Returns:
  The number of columns, or -1.

bool Gtk::IconView::get_cursor | ( | CellRenderer*& | cell | ) | const

Fills in path and cell with the current cursor path and cell.

If the cursor isn't currently set, then path will be empty. If no cell currently has focus, then cell will be NULL.

Parameters:

  | cell | The current focus cell.

Returns:
  true if the cursor is set.

Since gtkmm 2.8:

bool Gtk::IconView::get_cursor | ( | TreeModel::Path& | path | ) | const

Fills in path and cell with the current cursor path and cell.

If the cursor isn't currently set, then path will be empty. If no cell currently has focus, then cell will be NULL.

Parameters:

  | path | The current cursor path.

Returns:
  true if the cursor is set.

Since gtkmm 2.8:

bool Gtk::IconView::get_cursor | ( | TreeModel::Path& | path,
|  | CellRenderer*& | cell |
| ) |  |  | const

Fills in path and cell with the current cursor path and cell.

If the cursor isn't currently set, then path will be empty. If no cell currently has focus, then cell will be NULL.

Parameters:

  | path | The current cursor path.
  | cell | The current focus cell.

Returns:
  true if the cursor is set.

Since gtkmm 2.8:

bool Gtk::IconView::get_dest_item_at_pos | ( | int | drag_x,
|  | int | drag_y,
|  | IconViewDropPosition& | pos |
| ) |  |  | const

Determines the destination item for a given position.

Parameters:

  | drag_x | The position to determine the destination item for.
  | drag_y | the position to determine the destination item for.
  | pos,: | The drop position.

Returns:
  whether there is an item at the given position.

Since gtkmm 2.10:

bool Gtk::IconView::get_dest_item_at_pos | ( | int | drag_x,
|  | int | drag_y,
|  | TreeModel::Path& | path |
| ) |  |  | const

Determines the destination item for a given position.

Parameters:

  | drag_x | The position to determine the destination item for.
  | drag_y | the position to determine the destination item for.
  | path | The path of the item.

Returns:
  whether there is an item at the given position.

Since gtkmm 2.10:

bool Gtk::IconView::get_dest_item_at_pos | ( | int | drag_x,
|  | int | drag_y,
|  | TreeModel::Path& | path,
|  | IconViewDropPosition& | pos |
| ) |  |  | const

Determines the destination item for a given position.

Parameters:

  | drag_x | The position to determine the destination item for.
  | drag_y | the position to determine the destination item for.
  | path | The path of the item.
  | pos,: | The drop position.

Returns:
  whether there is an item at the given position.

Since gtkmm 2.10:

void Gtk::IconView::get_drag_dest_item | ( | IconViewDropPosition& | pos | ) | const

Gets information about the item that is highlighted for feedback.

The drop position.

Since gtkmm 2.10:

void Gtk::IconView::get_drag_dest_item | ( | TreeModel::Path& | path | ) | const

Gets information about the item that is highlighted for feedback.

Parameters:

  | path | The highlighted item.

Since gtkmm 2.10:

void Gtk::IconView::get_drag_dest_item | ( | TreeModel::Path& | path,
|  | IconViewDropPosition& | pos |
| ) |  |  | const

Gets information about the item that is highlighted for feedback.

Parameters:

  | path | The highlighted item. The drop position.

Since gtkmm 2.10:

int Gtk::IconView::get_icon_width | ( |  | ) | const

Returns the value of the item-width property.

Since gtkmm 2.6:

Returns:
  The width of a single item, or -1.

bool Gtk::IconView::get_item_at_pos | ( | int | x,
|  | int | y,
|  | CellRenderer*& | cell |
| ) |  |  | const

Finds the path at the point (x, y), relative to widget coordinates.

Parameters:

  | x | The x position to be identified.
  | y | The y position to be identified.
  | path | The path.

Returns:
  true if an item exists at the specified position.

Since gtkmm 2.6:

bool Gtk::IconView::get_item_at_pos | ( | int | x,
|  | int | y,
|  | TreeModel::Path& | path |
| ) |  |  | const

Finds the path at the point (x, y), relative to widget coordinates.

Parameters:

  | x | The x position to be identified.
  | y | The y position to be identified.
  | path | The path.

Returns:
  true if an item exists at the specified position.

Since gtkmm 2.6:

bool Gtk::IconView::get_item_at_pos | ( | int | x,
|  | int | y,
|  | TreeModel::Path& | path,
|  | CellRenderer*& | cell |
| ) |  |  | const

Finds the path at the point (x, y), relative to widget coordinates.

Parameters:

  | x | The x position to be identified.
  | y | The y position to be identified.
  | path | The path.
  | cell | The renderer responsible for the cell at (x, y).

Returns:
  true if an item exists at the specified position.

Since gtkmm 2.6:

int Gtk::IconView::get_margin | ( |  | ) | const

Returns the value of the margin property.

Since gtkmm 2.6:

Returns:
  The space at the borders.

int Gtk::IconView::get_markup_column | ( |  | ) | const

Returns the column with markup text for icon_view.

Since gtkmm 2.6:

Returns:
  The markup column, or -1 if it's unset.

Glib::RefPtr<const TreeModel> Gtk::IconView::get_model | ( |  | ) | const

Returns the model the Gtk::IconView is based on.

Returns `0` if the model is unset.

Since gtkmm 2.6:

Returns:
  A Gtk::TreeModel, or `0` if none is currently being used.

Glib::RefPtr<TreeModel> Gtk::IconView::get_model | ( |  | ) |

Returns the model the Gtk::IconView is based on.

Returns `0` if the model is unset.

Since gtkmm 2.6:

Returns:
  A Gtk::TreeModel, or `0` if none is currently being used.

Orientation Gtk::IconView::get_orientation | ( |  | ) | const

Returns the value of the orientation property which determines whether the labels are drawn beside the icons instead of below.

Since gtkmm 2.6:

Returns:
  The relative position of texts and icons.

TreeModel::Path Gtk::IconView::get_path_at_pos | ( | int | x,
|  | int | y |
| ) |  |  | const

Finds the path at the point ( x, y), relative to bin_window coordinates.

See get_item_at_pos(), if you are also interested in the cell at the specified position. See convert_widget_to_bin_window_coords() for converting widget coordinates to bin_window coordinates.

Since gtkmm 2.6:

Parameters:

  | x | The x position to be identified.
  | y | The y position to be identified.

Returns:
  The Gtk::TreePath corresponding to the icon or `0` if no icon exists at that position.

int Gtk::IconView::get_pixbuf_column | ( |  | ) | const

Returns the column with pixbufs for icon_view.

Since gtkmm 2.6:

Returns:
  The pixbuf column, or -1 if it's unset.

bool Gtk::IconView::get_reorderable | ( |  | ) | const

Retrieves whether the user can reorder the list via drag-and-drop.

See set_reorderable().

Since gtkmm 2.8:

Returns:
  `true` if the list can be reordered.

gint Gtk::IconView::get_row_spacing | ( |  | ) | const

Returns the value of the row-spacing property.

Since gtkmm 2.6:

Returns:
  The space between rows.

ArrayHandle_TreePaths Gtk::IconView::get_selected_items | ( |  | ) | const

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::Tree::row_reference_new().

To free the return value, use: |[ g_list_foreach (list, (GFunc)gtk_tree_path_free, `0`); g_list_free (list); ]|

Since gtkmm 2.6:

Returns:
  A List containing a Gtk::TreePath for each selected row.

SelectionMode Gtk::IconView::get_selection_mode | ( |  | ) | const

Gets the selection mode of the icon_view.

Since gtkmm 2.6:

Returns:
  The current selection mode.

int Gtk::IconView::get_spacing | ( |  | ) | const

Returns the value of the spacing property.

Since gtkmm 2.6:

Returns:
  The space between cells.

int Gtk::IconView::get_text_column | ( |  | ) | const

Returns the column with text for icon_view.

Since gtkmm 2.6:

Returns:
  The text column, or -1 if it's unset.

int Gtk::IconView::get_tooltip_column | ( |  | ) | const

Returns the column of icon_view's model which is being used for displaying tooltips on icon_view's rows.

Since gtkmm 2.12:

Returns:
  The index of the tooltip column that is currently being used, or -1 if this is disabled.

bool Gtk::IconView::get_tooltip_context_iter | ( | int & | x,
|  | int & | y,
|  | bool | keyboard_tip,
|  | Gtk::TreeModel::iterator& | iter |
| ) |  |  |

Parameters:

  | x,: | the x coordinate (relative to widget coordinates)
  | y,: | the y coordinate (relative to widget coordinates)
  | keyboard_tip,: | whether this is a keyboard tooltip or not
  | iter,: | a pointer to receive a Gtk::TreeIter

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 the iter which has 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 IconView's bin_window if keyboard_tooltip is false.

Return value: whether or not the given tooltip context points to a item.

Since gtkmm 2.12:

bool Gtk::IconView::get_tooltip_context_path | ( | int & | x,
|  | int & | y,
|  | bool | keyboard_tip,
|  | TreeModel::Path& | path |
| ) |  |  |

Parameters:

  | x,: | the x coordinate (relative to widget coordinates)
  | y,: | the y coordinate (relative to widget coordinates)
  | keyboard_tip,: | whether this is a keyboard tooltip or not
  | path,: | a reference to receive a Gtk::TreePath

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 the path which has 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 IconView's bin_window if keyboard_tooltip is false.

Return value: whether or not the given tooltip context points to a item.

Since gtkmm 2.12:

bool Gtk::IconView::get_visible_range | ( | TreeModel::Path& | start_path,
|  | TreeModel::Path& | end_path |
| ) |  |  | const

const GtkIconView* Gtk::IconView::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

GtkIconView* Gtk::IconView::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

void Gtk::IconView::item_activated | ( | const TreeModel::Path& | path | ) |

Activates the item determined by path.

Since gtkmm 2.6:

Parameters:

  | path | The Gtk::TreePath to be activated.

virtual void Gtk::IconView::on_item_activated | ( | const TreeModel::Path& | path | ) | `[protected, virtual]`

virtual void Gtk::IconView::on_selection_changed | ( |  | ) | `[protected, virtual]`

virtual void Gtk::IconView::on_set_scroll_adjustments | ( | Adjustment* | hadjustment,
|  | Adjustment* | vadjustment |
| ) |  |  | `[protected, virtual]`

bool Gtk::IconView::path_is_selected | ( | const TreeModel::Path& | path | ) | const

Returns `true` if the icon pointed to by path is currently selected.

If path does not point to a valid location, `false` is returned.

Since gtkmm 2.6:

Parameters:

  | path | A Gtk::TreePath to check selection on.

Returns:
  `true` if path is selected.

Glib::PropertyProxy_ReadOnly<int> Gtk::IconView::property_column_spacing | ( |  | ) | const

Space which is inserted between grid columns.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::IconView::property_column_spacing | ( |  | ) |

Space which is inserted between grid columns.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::IconView::property_columns | ( |  | ) | const

Number of columns to display.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::IconView::property_columns | ( |  | ) |

Number of columns to display.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::IconView::property_item_width | ( |  | ) | const

The width used for each item.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::IconView::property_item_width | ( |  | ) |

The width used for each item.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::IconView::property_margin | ( |  | ) | const

Space which is inserted at the edges of the icon view.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::IconView::property_margin | ( |  | ) |

Space which is inserted at the edges of the icon view.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::IconView::property_markup_column | ( |  | ) | const

Model column used to retrieve the text if using Pango markup.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::IconView::property_markup_column | ( |  | ) |

Model column used to retrieve the text if using Pango markup.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TreeModel> > Gtk::IconView::property_model | ( |  | ) | const

The model for the icon view.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy< Glib::RefPtr<TreeModel> > Gtk::IconView::property_model | ( |  | ) |

The model for the icon view.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Orientation> Gtk::IconView::property_orientation | ( |  | ) | const

How the text and icon of each item are positioned relative to each other.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Orientation> Gtk::IconView::property_orientation | ( |  | ) |

How the text and icon of each item are positioned relative to each other.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::IconView::property_pixbuf_column | ( |  | ) | const

Model column used to retrieve the icon pixbuf from.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::IconView::property_pixbuf_column | ( |  | ) |

Model column used to retrieve the icon pixbuf from.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::IconView::property_row_spacing | ( |  | ) | const

Space which is inserted between grid rows.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::IconView::property_row_spacing | ( |  | ) |

Space which is inserted between grid rows.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<SelectionMode> Gtk::IconView::property_selection_mode | ( |  | ) | const

The selection mode.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<SelectionMode> Gtk::IconView::property_selection_mode | ( |  | ) |

The selection mode.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::IconView::property_spacing | ( |  | ) | const

Space which is inserted between cells of an item.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::IconView::property_spacing | ( |  | ) |

Space which is inserted between cells of an item.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::IconView::property_text_column | ( |  | ) | const

Model column used to retrieve the text from.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::IconView::property_text_column | ( |  | ) |

Model column used to retrieve the text from.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::IconView::scroll_to_path | ( | const TreeModel::Path& | path,
|  | bool | use_align,
|  | gfloat | row_align,
|  | gfloat | 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.

Since gtkmm 2.8:

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.

void Gtk::IconView::select_all | ( |  | ) |

Selects all the icons.

icon_view must has its selection mode set to Gtk::SELECTION_MULTIPLE.

Since gtkmm 2.6:

void Gtk::IconView::select_path | ( | const TreeModel::Path& | path | ) |

Selects the row at path.

Since gtkmm 2.6:

Parameters:

  | path | The Gtk::TreePath to be selected.

void Gtk::IconView::selected_foreach | ( | const SlotForeach & | slot | ) |

Calls a function for each selected icon.

Note that the model or selection cannot be modified from within this function.

Parameters:

  | slot | The callback to call for each selected icon.

void Gtk::IconView::set_column_spacing | ( | int | column_spacing | ) |

Sets the column-spacing property which specifies the space which is inserted between the columns of the icon view.

Since gtkmm 2.6:

Parameters:

  | column_spacing | The column spacing.

void Gtk::IconView::set_columns | ( | 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.

Since gtkmm 2.6:

Parameters:

  | columns | The number of columns.

void Gtk::IconView::set_cursor | ( | const TreeModel::Path& | path,
|  | CellRenderer& | cell,
|  | bool | start_editing |
| ) |  |  |

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 `0`, 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 <literal>gtk_widget_grab_focus (icon_view)</literal> in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.

Since gtkmm 2.8:

Parameters:

  | path | A Gtk::TreePath.
  | cell | One of the cell renderers of icon_view, or `0`.
  | start_editing | `true` if the specified cell should start being edited.

void Gtk::IconView::set_drag_dest_item | ( | const TreeModel::Path& | path,
|  | IconViewDropPosition | pos |
| ) |  |  |

Sets the item that is highlighted for feedback.

Since gtkmm 2.8:

Parameters:

  | path | The path of the item to highlight, or `0`.
  | pos | Specifies where to drop, relative to the item.

void Gtk::IconView::set_item_width | ( | 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.

Since gtkmm 2.6:

Parameters:

  | item_width | The width for each item.

void Gtk::IconView::set_margin | ( | int | margin | ) |

Sets the margin property which specifies the space which is inserted at the top, bottom, left and right of the icon view.

Since gtkmm 2.6:

Parameters:

  | margin | The margin.

void Gtk::IconView::set_markup_column | ( | const TreeModelColumnBase& | column | ) |

Sets the column with markup information for icon_view to be column.

The markup column must be of type TYPE_STRING. If the markup column is set to something, it overrides the text column set by set_text_column().

Since gtkmm 2.6:

Parameters:

  | column | A column in the currently used model, or -1 to display no text.

void Gtk::IconView::set_markup_column | ( | int | column | ) |

Sets the column with markup information for icon_view to be column.

The markup column must be of type TYPE_STRING. If the markup column is set to something, it overrides the text column set by set_text_column().

Since gtkmm 2.6:

Parameters:

  | column | A column in the currently used model, or -1 to display no text.

void Gtk::IconView::set_model | ( | const Glib::RefPtr< TreeModel >& | model | ) |

Sets the model for a Gtk::IconView.

If the icon_view already has a model set, it will remove it before setting the new model. Use unset_model() to unset the old model.

Since gtkmm 2.6:

Parameters:

  | model | The model.

void Gtk::IconView::set_orientation | ( | Orientation | orientation | ) |

Sets the orientation property which determines whether the labels are drawn beside the icons instead of below.

Since gtkmm 2.6:

Parameters:

  | orientation | The relative position of texts and icons.

void Gtk::IconView::set_pixbuf_column | ( | const TreeModelColumnBase& | column | ) |

Sets the column with pixbufs for icon_view to be column.

The pixbuf column must be of type Gdk::TYPE_PIXBUF

Since gtkmm 2.6:

Parameters:

  | column | A column in the currently used model, or -1 to disable.

void Gtk::IconView::set_pixbuf_column | ( | int | column | ) |

Sets the column with pixbufs for icon_view to be column.

The pixbuf column must be of type Gdk::TYPE_PIXBUF

Since gtkmm 2.6:

Parameters:

  | column | A column in the currently used model, or -1 to disable.

void Gtk::IconView::set_reorderable | ( | bool | reorderable = `true` | ) |

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.

Since gtkmm 2.8:

Parameters:

  | reorderable | `true`, if the list of items can be reordered.

void Gtk::IconView::set_row_spacing | ( | int | row_spacing | ) |

Sets the row-spacing property which specifies the space which is inserted between the rows of the icon view.

Since gtkmm 2.6:

Parameters:

  | row_spacing | The row spacing.

void Gtk::IconView::set_selection_mode | ( | SelectionMode | mode | ) |

Sets the selection mode of the icon_view.

Since gtkmm 2.6:

Parameters:

  | mode | The selection mode.

void Gtk::IconView::set_spacing | ( | 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.

Since gtkmm 2.6:

Parameters:

  | spacing | The spacing.

void Gtk::IconView::set_text_column | ( | const TreeModelColumnBase& | model_column | ) |

Sets the column with text for icon_view to be column.

The text column must be of type TYPE_STRING.

Since gtkmm 2.6:

Parameters:

  | column | A column in the currently used model, or -1 to display no text.

void Gtk::IconView::set_text_column | ( | int | column | ) |

Sets the column with text for icon_view to be column.

The text column must be of type TYPE_STRING.

Since gtkmm 2.6:

Parameters:

  | column | A column in the currently used model, or -1 to display no text.

void Gtk::IconView::set_tooltip_cell | ( | const Glib::RefPtr< Tooltip >& | tooltip,
|  | const TreeModel::Path& | path |
| ) |  |  |

Sets the tip area of tooltip to the area occupied by the item pointed to by path.

See also Tooltip::set_tip_area().

Since gtkmm 2.12:

Parameters:

  | tooltip | A Gtk::Tooltip.
  | path | A Gtk::TreePath.

void Gtk::IconView::set_tooltip_cell | ( | const Glib::RefPtr< Tooltip >& | tooltip,
|  | const TreeModel::Path& | path,
|  | CellRenderer& | cell |
| ) |  |  |

Sets the tip area of tooltip to the area which cell occupies in the item pointed to by path.

See also Tooltip::set_tip_area().

Since gtkmm 2.12:

Parameters:

  | tooltip | A Gtk::Tooltip.
  | path | A Gtk::TreePath.
  | cell | A Gtk::CellRenderer.

void Gtk::IconView::set_tooltip_column | ( | int | column | ) |

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 icon_view's model containing the tooltip texts, or -1 to disable this feature.

When enabled, Gtk::Widget::has-tooltip will be set to `true` and icon_view will connect a Gtk::Widget::query-tooltip signal handler.

Since gtkmm 2.12:

Parameters:

  | column | An integer, which is a valid column number for icon_view's model.

void Gtk::IconView::set_tooltip_item | ( | const Glib::RefPtr< Tooltip >& | tooltip,
|  | const TreeModel::Path& | path |
| ) |  |  |

Sets the tip area of tooltip to be the area covered by the item at path.

See also Tooltip::set_tip_area().

Since gtkmm 2.12:

Parameters:

  | tooltip | A Gtk::Tooltip.
  | path | A Gtk::TreePath.

Glib::SignalProxy1< void,const TreeModel::Path& > Gtk::IconView::signal_item_activated | ( |  | ) |

Prototype:
  `void on_my_item_activated(const TreeModel::Path& path)`

Glib::SignalProxy0< void > Gtk::IconView::signal_selection_changed | ( |  | ) |

Prototype:
  `void on_my_selection_changed()`

Glib::SignalProxy2< void,Adjustment*,Adjustment* > Gtk::IconView::signal_set_scroll_adjustments | ( |  | ) |

Prototype:
  `void on_my_set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment)`

void Gtk::IconView::unselect_all | ( |  | ) |

Unselects all the icons.

Since gtkmm 2.6:

void Gtk::IconView::unselect_path | ( | const TreeModel::Path& | path | ) |

Unselects the row at path.

Since gtkmm 2.6:

Parameters:

  | path | The Gtk::TreePath to be unselected.

void Gtk::IconView::unset_model | ( |  | ) |

Remove the model from the IconView.

See also:
  set_model().

Since gtkmm 2.16:

void Gtk::IconView::unset_model_drag_dest | ( |  | ) |

Undoes the effect of enable_model_drag_dest().

Calling this method sets Gtk::IconView:reorderable to `false`.

Since gtkmm 2.8:

void Gtk::IconView::unset_model_drag_source | ( |  | ) |

Undoes the effect of enable_model_drag_source().

Calling this method sets Gtk::IconView:reorderable to `false`.

Since gtkmm 2.8:

## Friends And Related Function Documentation

Gtk::IconView* wrap | ( | GtkIconView * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gtkmm/iconview.h