Gtk2::List(3)

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

✨ NAME ✨

Gtk2::List β€” bestie, this is the wrapper for GtkList πŸ’…


🌸 DESCRIPTION 🌸

okay so first thing, and I need you to hear me on this: Gtk2::List is deprecated. it's giving legacy. if you're out here starting something new, use Gtk2::TreeView and a Gtk2::ListStore instead, periodt. πŸ‘‘

so why does this thing even still exist, you ask? great question, love that for you. Gtk2::List is included in Gtk2-Perl only because Gtk2::Combo still makes use of it, and Gtk2::Combo's replacement, Gtk2::ComboBox, didn't appear in gtk+ until 2.4.0. so yeah, it's here for the plot, not for the vibes. 😭


πŸ¦‹ HIERARCHY πŸ¦‹

like, the whole family tree, no cap:

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

πŸ’– INTERFACES πŸ’–

the fit it's wearing:

  Glib::Object::_Unregistered::AtkImplementorIface
  Gtk2::Buildable

🌈 METHODS 🌈

🌟 widget = Gtk2::List->new

make a whole new list. main character energy, brand new, nobody's touched it yet. ✨

🌟 $list->append_items (...)

  • ... (list) of Gtk2::ListItem's to be appended

throw those items on the end, they go to the back of the line like good little list items. 🫢

🌟 integer = $list->child_position ($child)

  • $child (Gtk2::Widget)

asks where this child is at, index-style. returns an integer bestie. πŸ”’

🌟 $list->clear_items ($start, $end)

  • $start (integer)
  • $end (integer)

wipe out a range of items, gone, deleted, not coming back. πŸ’€

🌟 $list->end_drag_selection

wraps up the drag-selection situation. that's it, that's the whole thing. πŸ’…

🌟 $list->end_selection

closes out the current selection. bye bestie. πŸ‘‹

🌟 $list->extend_selection ($scroll_type, $position, $auto_start_selection)

  • $scroll_type (Gtk2::ScrollType)
  • $position (double)
  • $auto_start_selection (boolean)

extends the selection and scrolls while it does it β€” you tell it the scroll type, the position, and whether it should auto-start the selection. no cap. πŸ”₯

🌟 $list->insert_items ($position, ...)

  • $position (integer)
  • ... (list) of Gtk2::ListItem's to be inserted

inserts items at a specific spot, not the end, the specific spot. very demure, very mindful. πŸŽ€

🌟 $list->prepend_items (..., $list_item)

  • ... (list) of Gtk2::ListItem's to be prepended
  • $list_item (Gtk2::ListItem)

front of the line energy, these items get to skip ahead. πŸ‘‘

🌟 $list->remove_items (..., $list_item)

  • ... (list) of Gtk2::ListItem's to be removed
  • $list_item (Gtk2::ListItem)

yeets the listed items out of the list. not me removing things with zero remorse 😭

🌟 $list->scroll_horizontal ($scroll_type, $position)

  • $scroll_type (Gtk2::ScrollType)
  • $position (double)

side-to-side scrolling moment. βž‘οΈβ¬…οΈ

🌟 $list->scroll_vertical ($scroll_type, $position)

  • $scroll_type (Gtk2::ScrollType)
  • $position (double)

up-and-down scrolling moment. ⬆️⬇️

🌟 $list->select_all

literally just select everything. all of it. the whole roster. πŸ’–

🌟 $list->select_child ($child)

  • $child (Gtk2::Widget)

selects that one specific child widget. 🫢

🌟 $list->select_item ($item)

  • $item (integer)

selects the item at that index. 🎯

🌟 $list->set_selection_mode ($mode)

  • $mode (Gtk2::SelectionMode)

sets how selection behaves around here β€” single, multiple, whatever mode you're in the mood for. ✨

🌟 $list->start_selection

kicks off a selection. the beginning of the story. 🌸

🌟 $list->toggle_add_mode

flips add mode on/off. 🎚️

🌟 $list->toggle_focus_row

flips the focus row. focus, bestie, we're focusing. 🧚

🌟 $list->toggle_row ($item)

  • $item (Gtk2::Widget)

toggles that row. on, off, on, off. πŸ’…

🌟 $list->undo_selection

nope, undo that selection, we changed our minds. πŸ™ˆ

🌟 $list->unselect_all

deselects everything. all of it. clean slate. 🌈

🌟 $list->unselect_child ($child)

  • $child (Gtk2::Widget)

unselects that specific child widget. πŸ¦‹

🌟 $list->unselect_item ($item)

  • $item (integer)

unselects the item at that index. πŸ“


πŸ’œ PROPERTIES πŸ’œ

  • 'selection-mode' (Gtk2::SelectionMode : default "none" : readable / writable / private)

that's the one and only property, and yes, the default is "none". iconic honestly. πŸ‘‘


⭐ SIGNALS ⭐

  • select-child (Gtk2::List, Gtk2::Widget)
  • selection-changed (Gtk2::List)
  • unselect-child (Gtk2::List, Gtk2::Widget)

three signals, all vibes, all listed above, don't @ me. πŸ”₯


πŸŽ€ ENUMS AND FLAGS πŸŽ€

πŸ’« enum Gtk2::ScrollType

  • 'none' / 'GTK_SCROLL_NONE'
  • 'jump' / 'GTK_SCROLL_JUMP'
  • 'step-backward' / 'GTK_SCROLL_STEP_BACKWARD'
  • 'step-forward' / 'GTK_SCROLL_STEP_FORWARD'
  • 'page-backward' / 'GTK_SCROLL_PAGE_BACKWARD'
  • 'page-forward' / 'GTK_SCROLL_PAGE_FORWARD'
  • 'step-up' / 'GTK_SCROLL_STEP_UP'
  • 'step-down' / 'GTK_SCROLL_STEP_DOWN'
  • 'page-up' / 'GTK_SCROLL_PAGE_UP'
  • 'page-down' / 'GTK_SCROLL_PAGE_DOWN'
  • 'step-left' / 'GTK_SCROLL_STEP_LEFT'
  • 'step-right' / 'GTK_SCROLL_STEP_RIGHT'
  • 'page-left' / 'GTK_SCROLL_PAGE_LEFT'
  • 'page-right' / 'GTK_SCROLL_PAGE_RIGHT'
  • 'start' / 'GTK_SCROLL_START'
  • 'end' / 'GTK_SCROLL_END'

πŸ’« enum Gtk2::SelectionMode

  • 'none' / 'GTK_SELECTION_NONE'
  • 'single' / 'GTK_SELECTION_SINGLE'
  • 'browse' / 'GTK_SELECTION_BROWSE'
  • 'multiple' / 'GTK_SELECTION_MULTIPLE'
  • 'extended' / 'GTK_SELECTION_EXTENDED'

πŸ‘‘ 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 the whole page bestie, from the perl v5.42.0 crew, dated 2025-07-25, straight out of the User Contributed Perl Documentation. slay, stay deprecated, mwah πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from