Gtk2::IconView(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

✨ NAME ✨

okay so bestie, Gtk2::IconView β€” wrapper for GtkIconView. that's the whole assignment. this is the Gtk2::IconView(3) page from User Contributed Perl Documentation, and we're about to go through every method, property, style property, and signal like it's a group chat recap. no cap πŸ’–


πŸ¦‹ HIERARCHY πŸ¦‹

the family tree is giving legacy code royalty:

Glib::Object
+----Glib::InitiallyUnowned
     +----Gtk2::Object
          +----Gtk2::Widget
               +----Gtk2::Container
                    +----Gtk2::IconView

πŸ’… INTERFACES πŸ’…

it also rocks these interfaces, periodt:

  • Glib::Object::_Unregistered::AtkImplementorIface
  • Gtk2::Buildable
  • Gtk2::CellLayout

🌸 METHODS 🌸

okay bestie, here's every method. keep your fave close and your $icon_view closer.

  • widget = Gtk2::IconView->new β€” brand new icon view, no model attached yet. fresh out the box ✨
  • widget = Gtk2::IconView->new_with_model ($model) β€” same energy, but you hand it a model right away.
    • $model (Gtk2::TreeModel) β€” the model it rides with.
  • integer = $icon_view->get_column_spacing / $icon_view->set_column_spacing ($column_spacing) β€” get or set the space between grid columns.
    • $column_spacing (integer) β€” the spacing value.
  • integer = $icon_view->get_columns / $icon_view->set_columns ($columns) β€” get or set how many columns to display.
    • $columns (integer) β€” the column count.
  • (bx, by) = $icon_view->convert_widget_to_bin_window_coords ($wx, $wy) β€” converts widget coords to bin window coords.
    • $wx (integer)
    • $wy (integer)
    • Since: gtk+ 2.12
  • pixmap = $icon_view->create_drag_icon ($path) β€” makes a drag icon from a path.
    • $path (Gtk2::TreePath)
    • Since: gtk+ 2.8
  • list = $icon_view->get_cursor β€” gets the cursor.
    • Since: gtk+ 2.8
  • $icon_view->set_cursor ($path, $cell, $start_editing) β€” sets the cursor.
    • $path (Gtk2::TreePath)
    • $cell (Gtk2::CellRenderer or undef)
    • $start_editing (boolean)
    • Since: gtk+ 2.8
  • $icon_view->get_dest_item_at_pos ($drag_x, $drag_y) β€” gets the destination item at a position.
    • $drag_x (integer)
    • $drag_y (integer)
    • Since: gtk+ 2.8
  • list = $icon_view->get_drag_dest_item β€” gets the drag destination item.
    • Since: gtk+ 2.8
  • $icon_view->set_drag_dest_item ($path, $pos) β€” sets the drag destination item.
    • $path (Gtk2::TreePath)
    • $pos (Gtk2::IconView::DropPosition)
    • Since: gtk+ 2.8
  • $icon_view->enable_model_drag_dest ($actions, ...) β€” enables model drag dest.
    • $actions (Gtk2::Gdk::DragAction)
    • ... (list) of Gtk2::TargetEntry's
    • Since: gtk+ 2.8
  • $icon_view->enable_model_drag_source ($start_button_mask, $actions, ...) β€” enables model drag source.
    • $start_button_mask (Gtk2::Gdk::ModifierType)
    • $actions (Gtk2::Gdk::DragAction)
    • ... (list) of Gtk2::TargetEntry's
    • Since: gtk+ 2.8
  • $icon_view->item_activated ($path) β€” item activated.
    • $path (Gtk2::TreePath)
  • $icon_view->get_item_at_pos ($x, $y) β€” gets the item at a position.
    • $x (integer)
    • $y (integer)
    • Since: gtk+ 2.8
  • integer = $icon_view->get_item_column ($path) β€” gets the item column.
    • $path (Gtk2::TreePath)
    • Since: gtk+ 2.22
  • orientation = $icon_view->get_item_orientation β€” gets the item orientation.
    • Since: gtk+ 2.22
  • $icon_view->set_item_orientation ($orientation) β€” sets the item orientation.
    • $orientation (Gtk2::Orientation)
    • Since: gtk+ 2.22
  • integer = $icon_view->get_item_padding β€” gets the item padding.
    • Since: gtk+ 2.18
  • $icon_view->set_item_padding ($item_padding) β€” sets the item padding.
    • $item_padding (integer)
    • Since: gtk+ 2.18
  • integer = $icon_view->get_item_row ($path) β€” gets the item row.
    • $path (Gtk2::TreePath)
    • Since: gtk+ 2.22
  • integer = $icon_view->get_item_width / $icon_view->set_item_width ($item_width) β€” get or set the item width.
    • $item_width (integer)
  • integer = $icon_view->get_margin / $icon_view->set_margin ($margin) β€” get or set the margin.
    • $margin (integer)
  • integer = $icon_view->get_markup_column / $icon_view->set_markup_column ($column) β€” get or set the markup column.
    • $column (integer)
  • treemodel = $icon_view->get_model / $icon_view->set_model ($model) β€” get or set the model.
    • $model (Gtk2::TreeModel)
  • orientation = $icon_view->get_orientation / $icon_view->set_orientation ($orientation) β€” get or set the orientation.
    • $orientation (Gtk2::Orientation)
  • treepath = $icon_view->get_path_at_pos ($x, $y) β€” gets the path at a position.
    • $x (integer)
    • $y (integer)
  • boolean = $icon_view->path_is_selected ($path) β€” checks if a path is selected.
    • $path (Gtk2::TreePath)
  • integer = $icon_view->get_pixbuf_column / $icon_view->set_pixbuf_column ($column) β€” get or set the pixbuf column.
    • $column (integer)
  • boolean = $icon_view->get_reorderable β€” gets whether it's reorderable.
    • Since: gtk+ 2.8
  • $icon_view->set_reorderable ($reorderable) β€” sets whether it's reorderable.
    • $reorderable (boolean)
    • Since: gtk+ 2.8
  • integer = $icon_view->get_row_spacing / $icon_view->set_row_spacing ($row_spacing) β€” get or set the row spacing.
    • $row_spacing (integer)
  • $icon_view->scroll_to_path ($path, $use_align=FALSE, $row_align=0.0, $col_align=0.0) β€” scrolls to a path.
    • $path (Gtk2::TreePath)
    • $use_align (boolean)
    • $row_align (double)
    • $col_align (double)
    • Since: gtk+ 2.8
  • $icon_view->select_all β€” selects all. periodt.
  • $icon_view->select_path ($path) β€” selects a path.
    • $path (Gtk2::TreePath)
  • $icon_view->selected_foreach ($func, $data=undef) β€” runs a function for each selected item.
    • $func (scalar)
    • $data (scalar)
  • list = $icon_view->get_selected_items β€” gets the selected items.
  • selectionmode = $icon_view->get_selection_mode / $icon_view->set_selection_mode ($mode) β€” get or set the selection mode.
    • $mode (Gtk2::SelectionMode)
  • integer = $icon_view->get_spacing / $icon_view->set_spacing ($spacing) β€” get or set the spacing.
    • $spacing (integer)
  • integer = $icon_view->get_text_column / $icon_view->set_text_column ($column) β€” get or set the text column.
    • $column (integer)
  • $icon_view->set_tooltip_cell ($tooltip, $path, $cell) β€” sets the tooltip cell.
    • $tooltip (Gtk2::Tooltip)
    • $path (Gtk2::TreePath)
    • $cell (Gtk2::CellRenderer)
    • Since: gtk+ 2.12
  • integer = $icon_view->get_tooltip_column β€” gets the tooltip column.
    • Since: gtk+ 2.12
  • $icon_view->set_tooltip_column ($column) β€” sets the tooltip column.
    • $column (integer)
    • Since: gtk+ 2.12
  • list = $icon_view->get_tooltip_context ($x, $y, $keyboard_tip) β€” gets the tooltip context.
    • $x (integer)
    • $y (integer)
    • $keyboard_tip (boolean)
    • Since: gtk+ 2.12
  • $icon_view->set_tooltip_item ($tooltip, $path) β€” sets the tooltip item.
    • $tooltip (Gtk2::Tooltip)
    • $path (Gtk2::TreePath)
    • Since: gtk+ 2.12
  • $icon_view->unselect_all β€” unselects all.
  • $icon_view->unselect_path ($path) β€” unselects a path.
    • $path (Gtk2::TreePath)
  • $icon_view->unset_model_drag_dest β€” unsets model drag dest.
    • Since: gtk+ 2.8
  • $icon_view->unset_model_drag_source β€” unsets model drag source.
    • Since: gtk+ 2.8
  • list = $icon_view->get_visible_range β€” gets the visible range.
    • Since: gtk+ 2.8

πŸŽ€ PROPERTIES πŸŽ€

these are the properties, bestie. each one is literally a vibe:

  • 'column-spacing' (integer : default 6 : readable / writable / private / static-nick / static-blurb) β€” Space which is inserted between grid columns πŸ’–
  • 'columns' (integer : default -1 : readable / writable / private / static-nick / static-blurb) β€” Number of columns to display ✨
  • 'item-orientation' (Gtk2::Orientation : default "vertical" : readable / writable / private / static-nick / static-blurb) β€” How the text and icon of each item are positioned relative to each other πŸ¦‹
  • 'item-padding' (integer : default 6 : readable / writable / private / static-nick / static-blurb) β€” Padding around icon view items πŸŽ€
  • 'item-width' (integer : default -1 : readable / writable / private / static-nick / static-blurb) β€” The width used for each item 🌸
  • 'margin' (integer : default 6 : readable / writable / private / static-nick / static-blurb) β€” Space which is inserted at the edges of the icon view πŸ’…
  • 'markup-column' (integer : default -1 : readable / writable / private / static-nick / static-blurb) β€” Model column used to retrieve the text if using Pango markup 🫢
  • 'model' (Gtk2::TreeModel : default undef : readable / writable / private / static-nick / static-blurb) β€” The model for the icon view 😭
  • 'orientation' (Gtk2::Orientation : default "vertical" : readable / writable / private / static-nick / static-blurb / deprecated) β€” How the text and icon of each item are positioned relative to each other. it's deprecated, bestie, so don't get too attached πŸ’€
  • 'pixbuf-column' (integer : default -1 : readable / writable / private / static-nick / static-blurb) β€” Model column used to retrieve the icon pixbuf from πŸ”₯
  • 'reorderable' (boolean : default false : readable / writable) β€” View is reorderable πŸ‘‘
  • 'row-spacing' (integer : default 6 : readable / writable / private / static-nick / static-blurb) β€” Space which is inserted between grid rows 🌈
  • 'selection-mode' (Gtk2::SelectionMode : default "single" : readable / writable / private / static-nick / static-blurb) β€” The selection mode ⭐
  • 'spacing' (integer : default 0 : readable / writable / private / static-nick / static-blurb) β€” Space which is inserted between cells of an item πŸ’€
  • 'text-column' (integer : default -1 : readable / writable / private / static-nick / static-blurb) β€” Model column used to retrieve the text from πŸ™ˆ
  • 'tooltip-column' (integer : default -1 : readable / writable / private / static-nick / static-blurb) β€” The column in the model containing the tooltip texts for the items πŸ“

⭐ STYLE PROPERTIES ⭐

style properties, aka the lewk:

  • 'selection-box-alpha' (Glib::UChar : default 64 : readable / private / static-nick / static-blurb) β€” Opacity of the selection box ✨
  • 'selection-box-color' (Gtk2::Gdk::Color : default undef : readable / private / static-nick / static-blurb) β€” Color of the selection box 🌈

πŸ”₯ SIGNALS πŸ”₯

the signals, no cap:

  • boolean = activate-cursor-item (Gtk2::IconView) β€” activate cursor item.
  • item-activated (Gtk2::IconView, Gtk2::TreePath) β€” item activated.
  • boolean = move-cursor (Gtk2::IconView, Gtk2::MovementStep, integer) β€” move cursor.
  • select-all (Gtk2::IconView) β€” select all.
  • select-cursor-item (Gtk2::IconView) β€” select cursor item.
  • selection-changed (Gtk2::IconView) β€” selection changed.
  • set-scroll-adjustments (Gtk2::IconView, Gtk2::Adjustment, Gtk2::Adjustment) β€” set scroll adjustments.
  • toggle-cursor-item (Gtk2::IconView) β€” toggle cursor item.
  • unselect-all (Gtk2::IconView) β€” unselect all.

✨ ENUMS AND FLAGS ✨

okay bestie, this is the part where we meet all the little named constants you'll be throwing around πŸ’– every single one of these shows up in two outfits: the lowercase perl string you actually type in your code, and the big shouty C constant underneath. same girl, different lewk. use whichever one your function is asking for and you're golden ✨


πŸ¦‹ flags Gtk2::Gdk::DragAction

  • 'default' / GDK_ACTION_DEFAULT β€” the baseline, the blueprint, the "we'll figure it out" of drag actions πŸ’…
  • 'copy' / GDK_ACTION_COPY β€” copy vibes, no cap
  • 'move' / GDK_ACTION_MOVE β€” she moves, that's the whole thing
  • 'link' / GDK_ACTION_LINK β€” the linking one, periodt
  • 'private' / GDK_ACTION_PRIVATE β€” private mode, don't ask, don't tell πŸ™ˆ
  • 'ask' / GDK_ACTION_ASK β€” literally just asking, iconic behavior

πŸŽ€ flags Gtk2::Gdk::ModifierType

  • 'shift-mask' / GDK_SHIFT_MASK β€” shift energy, she's here
  • 'lock-mask' / GDK_LOCK_MASK β€” locked in πŸ”’
  • 'control-mask' / GDK_CONTROL_MASK β€” control, as the name suggests, main character
  • 'mod1-mask' / GDK_MOD1_MASK β€” mod1, no notes
  • 'mod2-mask' / GDK_MOD2_MASK β€” mod2, also no notes
  • 'mod3-mask' / GDK_MOD3_MASK β€” mod3, we stay consistent
  • 'mod4-mask' / GDK_MOD4_MASK β€” mod4, the middle child
  • 'mod5-mask' / GDK_MOD5_MASK β€” mod5, last of the mods 😭
  • 'button1-mask' / GDK_BUTTON1_MASK β€” button 1 representation πŸ’–
  • 'button2-mask' / GDK_BUTTON2_MASK β€” button 2 representation
  • 'button3-mask' / GDK_BUTTON3_MASK β€” button 3 representation
  • 'button4-mask' / GDK_BUTTON4_MASK β€” button 4 representation
  • 'button5-mask' / GDK_BUTTON5_MASK β€” button 5 representation, the whole set ate
  • 'super-mask' / GDK_SUPER_MASK β€” super, obviously πŸ’…
  • 'hyper-mask' / GDK_HYPER_MASK β€” hyper, even more obviously
  • 'meta-mask' / GDK_META_MASK β€” meta, she's meta about it
  • 'release-mask' / GDK_RELEASE_MASK β€” the release one πŸ¦‹
  • 'modifier-mask' / GDK_MODIFIER_MASK β€” the catch-all, the mother of all masks, the one that contains multitudes πŸ‘‘

🌸 enum Gtk2::IconView::DropPosition

  • 'no-drop' / GTK_ICON_VIEW_NO_DROP β€” absolutely not dropping, we said no πŸ’€
  • 'drop-into' / GTK_ICON_VIEW_DROP_INTO β€” drop into, cozy
  • 'drop-left' / GTK_ICON_VIEW_DROP_LEFT β€” to the left, to the left 🎢
  • 'drop-right' / GTK_ICON_VIEW_DROP_RIGHT β€” right side bestie
  • 'drop-above' / GTK_ICON_VIEW_DROP_ABOVE β€” up top
  • 'drop-below' / GTK_ICON_VIEW_DROP_BELOW β€” down low, keep it on the lowkey

⭐ enum Gtk2::MovementStep

  • 'logical-positions' / GTK_MOVEMENT_LOGICAL_POSITIONS β€” logical positions, staying rational
  • 'visual-positions' / GTK_MOVEMENT_VISUAL_POSITIONS β€” visual positions, aesthetics first ✨
  • 'words' / GTK_MOVEMENT_WORDS β€” words. yes. those.
  • 'display-lines' / GTK_MOVEMENT_DISPLAY_LINES β€” display lines, the lines you see
  • 'display-line-ends' / GTK_MOVEMENT_DISPLAY_LINE_ENDS β€” the ends of those exact lines
  • 'paragraphs' / GTK_MOVEMENT_PARAGRAPHS β€” paragraphs, she's long-winded fr
  • 'paragraph-ends' / GTK_MOVEMENT_PARAGRAPH_ENDS β€” ends of the paragraphs
  • 'pages' / GTK_MOVEMENT_PAGES β€” pages, turn turn turn
  • 'buffer-ends' / GTK_MOVEMENT_BUFFER_ENDS β€” the very ends of the buffer 🫢
  • 'horizontal-pages' / GTK_MOVEMENT_HORIZONTAL_PAGES β€” pages but sideways, lowkey a serve

🌈 enum Gtk2::Orientation

  • 'horizontal' / GTK_ORIENTATION_HORIZONTAL β€” sideways, lying down, resting πŸ’…
  • 'vertical' / GTK_ORIENTATION_VERTICAL β€” standing up tall, posture immaculate

πŸ’œ enum Gtk2::SelectionMode

  • 'none' / GTK_SELECTION_NONE β€” no selection, none, zero, nada πŸ’€
  • 'single' / GTK_SELECTION_SINGLE β€” one and only one, monogamous selection
  • 'browse' / GTK_SELECTION_BROWSE β€” browse mode, she's shopping
  • 'multiple' / GTK_SELECTION_MULTIPLE β€” multiple, polyamorous selection, we love
  • 'extended' / GTK_SELECTION_EXTENDED β€” extended, the deluxe version πŸ‘‘

πŸŽ€ SEE ALSO

  • Gtk2
  • Glib::Object
  • Glib::InitiallyUnowned
  • Gtk2::Object
  • Gtk2::Widget
  • Gtk2::Container

go read those too, iykyk πŸ“šβœ¨


Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.


and that's a wrap on the whole page bestie 🫢 this was Gtk2::IconView(3) from perl v5.42.0, dated 2025-07-25 β€” go build something iconic with it, ily, mwah πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from