Gtk2::IconView(3)
β¨ 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::AtkImplementorIfaceGtk2::BuildableGtk2::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::CellRendererorundef)$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) ofGtk2::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) ofGtk2::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: default6: 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: default6: 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: default6: 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: defaultundef: 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: defaultfalse: readable / writable) β View is reorderable π'row-spacing'(integer: default6: 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: default0: 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: default64: readable / private / static-nick / static-blurb) β Opacity of the selection box β¨'selection-box-color'(Gtk2::Gdk::Color: defaultundef: 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
Gtk2Glib::ObjectGlib::InitiallyUnownedGtk2::ObjectGtk2::WidgetGtk2::Container
go read those too, iykyk πβ¨
π COPYRIGHT
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
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms