Gtk2::ListStore(3)
π NAME π
Gtk2::ListStore β it's the wrapper for GtkListStore, bestie. This is the Gtk2::ListStore(3) manual page, and yes we are reading it together like it's a group chat at 2am. π¦
π HIERARCHY π
Here's the family tree, and she's an only child:
Glib::Object
+----Gtk2::ListStore
β¨ INTERFACES β¨
The way she collects interfaces like friendship bracelets, honestly iconic:
Gtk2::TreeModelGtk2::TreeDragSourceGtk2::TreeDragDestGtk2::TreeSortableGtk2::Buildable
π METHODS π
liststore = Gtk2::ListStore->new (...)
...β (list) of strings π
So you just hand her a list of strings and she's born. Slay.
treeiter = $list_store->append
$list_store->clear
$list_store->set_column_types (...)
...β (list) of strings
Give her the column types and she's set up fr fr.
$list_store->set ($iter, $col1, $val1, ...)
$iterβ (Gtk2::TreeIter)$col1β (integer) the first column number$val1β (scalar) the first value...β (list) pairs of column numbers and values
Pairs, bestie. Column number, then value. Column number, then value. That's the whole vibe. π«Ά
treeiter = $list_store->insert ($position)
$positionβ (integer)
treeiter = $list_store->insert_after ($sibling)
$siblingβ (Gtk2::TreeIterorundef)
treeiter = $list_store->insert_before ($sibling)
$siblingβ (Gtk2::TreeIterorundef)
treeiter = $list_store->insert_with_values ($position, ...)
$positionβ (integer) position to insert the new row...β (list) pairs of column numbers and values
Okay so this is literally insert followed by set, EXCEPT β and this is the important part β insert_with_values emits only the row-inserted signal. Not row-inserted, row-changed, and (if the store is sorted) rows-reordered like you'd get in the multiple-operation case. And because emitting the rows-reordered signal over and over can affect the performance of your program, insert_with_values should generally be preferred when you're inserting rows in a sorted list store. Performance queen behavior. π
Since: gtk+ 2.6
boolean = $list_store->iter_is_valid ($iter)
$iterβ (Gtk2::TreeIter)
Since: gtk+ 2.2
$store->move_after ($iter, $position)
$iterβ (Gtk2::TreeIter)$positionβ (Gtk2::TreeIterorundef)
Since: gtk+ 2.2
$store->move_before ($iter, $position)
$iterβ (Gtk2::TreeIter)$positionβ (Gtk2::TreeIterorundef)
Since: gtk+ 2.2
treeiter = $list_store->prepend
boolean = $list_store->remove ($iter)
$iterβ (Gtk2::TreeIter)
The return is always a boolean, in the style of Gtk 2.2.x and up, even when you're running on Gtk 2.0.x. She's consistent like that. β¨
$store->reorder (...)
...β (list) of integers, the reordered positions
She reorders the store to follow the order indicated by new_order. Heads up though: this function only works with unsorted stores. And you gotta pass a list of positions β one for each item in the list. No skipping, bestie, one per item, periodt.
Since: gtk+ 2.2
$store->swap ($a, $b)
$aβ (Gtk2::TreeIter)$bβ (Gtk2::TreeIter)
Since: gtk+ 2.2
$list_store->set_value ($iter, $col, $val)
$iterβ (Gtk2::TreeIter)$valβ (scalar)$colβ (integer)
Yes the bullets are in that order but the signature up top is the real one β $iter, $col, $val. Iykyk. π
πΈ SEE ALSO πΈ
Gtk2Glib::Object
π 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! This was perl v5.42.0, dated 2025-07-25, filed under Gtk2::ListStore(3). Go forth and build your list store, you absolute main character. π¦ππ
π¦ 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