Gtk2::TreeStore(3)
π Gtk2::TreeStore β the manual, but make it cute β¨
okay bestie, gather round, because this is Gtk2::TreeStore(3) from the User Contributed Perl Documentation and it is literally the wrapper for GtkTreeStore. it's giving tree-shaped data structure energy and we are obsessed. π³π
πΈ NAME πΈ
Gtk2::TreeStore β the wrapper for GtkTreeStore, no cap. that's it, that's the name, she's simple and she's iconic. π
π¦ HIERARCHY π¦
here's the family tree (pun fully intended, i'm hilarious):
Glib::Object
+----Gtk2::TreeStore
so she's a Glib::Object and Gtk2::TreeStore is her glow-up era. periodt. β¨
π INTERFACES π
the vibes she's serving (she implements all of these):
Gtk2::TreeModelGtk2::TreeDragSourceGtk2::TreeDragDestGtk2::TreeSortableGtk2::Buildable
five whole interfaces?? she's the main character fr fr. π
β¨ METHODS β¨
π· treestore = Gtk2::TreeStore->new (...)
build a brand new store, fresh out of the box, no baggage.
...β a (list) of strings, package names
π· treeiter = $tree_store->append ($parent)
slap a new row on the end, like adding a story to your close friends list. π²
$parentβ aGtk2::TreeIter, orundef
π· $tree_store->clear
wipe it. all of it. clean slate, new me, no notes. π
π· $tree_store->set_column_types (...)
...β a (list) of strings, package names
π· $tree_store->set ($iter, $col1, $val1, ...)
set the values, drop the data, slay.
$iterβ aGtk2::TreeIter$col1β (integer) the first column number$val1β (scalar) the first value...β (list) pairs of columns and values
π· treeiter = $tree_store->insert ($parent, $position)
$parentβ aGtk2::TreeIter, orundef$positionβ (integer)
π· treeiter = $tree_store->insert_after ($parent, $sibling)
$parentβ aGtk2::TreeIter, orundef$siblingβ aGtk2::TreeIter, orundef
π· treeiter = $tree_store->insert_before ($parent, $sibling)
$parentβ aGtk2::TreeIter, orundef$siblingβ aGtk2::TreeIter, orundef
π· treeiter = $tree_store->insert_with_values ($parent, $position, ...)
$parentβ aGtk2::TreeIter, orundef$positionβ (integer) position to insert the new row...β (list) pairs of column numbers and values
okay so this one is basically doing insert and then set, EXCEPT β and this is the important part, don't skip it β insert_with_values emits only the row-inserted signal, instead of row-inserted, row-changed, and, if the store is sorted, rows-reordered like you'd get in the multiple-operation case. since emitting the rows-reordered signal over and over can genuinely mess with your program's performance, insert_with_values should generally be your fave when you're inserting rows into a sorted tree store. π
Since: gtk+ 2.10 β vintage but still valid, she's aged like fine wine. π·
π· boolean = $tree_store->is_ancestor ($iter, $descendant)
$iterβ aGtk2::TreeIter$descendantβ aGtk2::TreeIter
π· integer = $tree_store->iter_depth ($iter)
$iterβ aGtk2::TreeIter
π· boolean = $tree_store->iter_is_valid ($iter)
$iterβ aGtk2::TreeIter
Since: gtk+ 2.2
π· $tree_store->move_after ($iter, $position)
$iterβ aGtk2::TreeIter$positionβ aGtk2::TreeIter, orundef
Since: gtk+ 2.2
π· $tree_store->move_before ($iter, $position)
$iterβ aGtk2::TreeIter$positionβ aGtk2::TreeIter, orundef
Since: gtk+ 2.2
π· treeiter = $tree_store->prepend ($parent)
$parentβ aGtk2::TreeIter, orundef
π· boolean = $tree_store->remove ($iter)
$iterβ aGtk2::TreeIter
heads up bestie: 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. consistency queen. π
π· $tree_store->reorder ($parent, ...)
$parentβ aGtk2::TreeIter, orundef...β (list) of integer's, thenew_order
Since: gtk+ 2.2
π· $tree_store->swap ($a, $b)
$aβ aGtk2::TreeIter$bβ aGtk2::TreeIter
Since: gtk+ 2.2
π· $tree_store->set_value ($iter, $col1, $val1, ...)
$iterβ aGtk2::TreeIter$col1β (integer) the first column number$val1β (scalar) the first value...β (list) pairs of columns and values
she's just an alias for Gtk2::TreeStore::set(). same girl, different name, iykyk. π
π SEE ALSO π
go read up on these if you want the full lore:
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, you ate. π«Ά this was perl v5.42.0 on 2025-07-25, signing off β stay iconic, stay sorted, and remember: Gtk2::TreeStore(3) loves you. πΈπβ¨
π¦ 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