Gtk2::List(3)
β¨ 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 πΈ
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
- 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