Gtk2::T...wColumn(3)
π Gtk2::TreeViewColumn π
okay bestie, so the manual name is Gtk2::TreeViewColumn and it's literally a wrapper for GtkTreeViewColumn. that's the whole vibe. it's giving "the thing that makes a column in your tree view". no cap. π
β¨ HIERARCHY β¨
like, who does it think it is? here's the family tree fr fr:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::TreeViewColumn
so it's a Gtk2::Object at heart, which is a Glib::InitiallyUnowned, which is a Glib::Object. generational talent honestly. π
πΈ INTERFACES πΈ
it also serves looks from these:
Gtk2::CellLayoutGtk2::Buildable
π METHODS π
okay here's the main character section. buckle up.
treeviewcolumn = Gtk2::TreeViewColumn->newβ makes you a brand new tree view column. iconic, no args, just vibes.treeviewcolumn = Gtk2::TreeViewColumn->new_with_attributes ($title, $cell, $attr1, $col1, ...)β new column but it already knows its attributes, slay.$title(string)$cell(Gtk2::CellRenderer)...(list) pairs of attributes and columns$col1(integer) the first column$attr1(string) the first attribute
$tree_column->add_attribute ($cell_renderer, $attribute, $column)β adds one attribute to one cell renderer. simple. clean. π$cell_renderer(Gtk2::CellRenderer)$attribute(string)$column(integer)
double = $tree_column->get_alignmentβ gets the alignment, returns adouble.$tree_column->set_alignment ($xalign)β sets the alignment bestie.$xalign(double)
$tree_column->set_attributes ($cell_renderer, ..., $col1, $attr1)β sets a whole bunch of attributes at once.$cell_renderer(Gtk2::CellRenderer)...(list) pairs of attributes and columns$col1(integer) the first column$attr1(string) the first attribute
$tree_column->set_cell_data_func ($cell_renderer, $func, $data=undef)β installs$funcas the callback that gets used whenever$columnneeds to set up$cellto render a cell.$funcshould look exactly like this:
sub cell_data_func {
my ($column, $cell, $model, $iter, $func_data) = @_;
}
and it should set whatever properties of $cell are required for it to draw the data properly. no return value is expected. periodt.
$cell_renderer(Gtk2::CellRenderer)$func(subroutine)$data(scalar)
(start_pos, width) = $tree_column->cell_get_position ($cell_renderer)β gives you back a start position and a width. Since: gtk+ 2.2 π¦$cell_renderer(Gtk2::CellRenderer)
list = $tree_column->cell_get_sizeβ returns a list, that's it, that's the tweet.boolean = $tree_column->cell_is_visibleβ true or false, is the cell visible.list = $tree_column->get_cell_renderersβ Returns a list of Gtk2::CellRenderer's. π«Ά$tree_column->cell_set_cell_data ($tree_model, $iter, $is_expander, $is_expanded)β sets the cell data, duh.$tree_model(Gtk2::TreeModel)$iter(Gtk2::TreeIter)$is_expander(boolean)$is_expanded(boolean)
$tree_column->clearβ clears it. bye bye. π$tree_column->clear_attributes ($cell_renderer)β clears the attributes off that renderer.$cell_renderer(Gtk2::CellRenderer)
boolean = $tree_column->get_clickableβ can you click it? boolean says.$tree_column->set_clickable ($clickable)β decides if you can click it.$clickable(boolean)
$tree_column->clickedβ the clicked method, as in emits/does the clicked thing.boolean = $tree_column->get_expandβ Since: gtk+ 2.4$tree_column->set_expand ($expand)β Since: gtk+ 2.4$expand(boolean)
integer = $tree_column->get_fixed_widthβ returns an integer, the fixed width.$tree_column->set_fixed_width ($fixed_width)β sets the fixed width.$fixed_width(integer)
$tree_column->focus_cell ($cell)β Since: gtk+ 2.2 β¨$cell(Gtk2::CellRenderer)
integer = $tree_column->get_max_widthβ the max width, as an integer.$tree_column->set_max_width ($max_width)β set the max width.$max_width(integer)
integer = $tree_column->get_min_widthβ the min width, as an integer.$tree_column->set_min_width ($min_width)β set the min width.$min_width(integer)
$tree_column->pack_end ($cell, $expand)β packs the cell at the end.$cell(Gtk2::CellRenderer)$expand(boolean)
$tree_column->pack_start ($cell, $expand)β packs the cell at the start.$cell(Gtk2::CellRenderer)$expand(boolean)
$tree_column->queue_resizeβ Since: gtk+ 2.8 πboolean = $tree_column->get_reorderableβ can you reorder it? boolean.$tree_column->set_reorderable ($reorderable)β set whether you can reorder it.$reorderable(boolean)
boolean = $tree_column->get_resizableβ is it resizable? boolean.$tree_column->set_resizable ($resizable)β set resizable-ness.$resizable(boolean)
treeviewcolumnsizing = $tree_column->get_sizingβ returns atreeviewcolumnsizing(that's aGtk2::TreeViewColumnSizing).$tree_column->set_sizing ($type)β sets the sizing type.$type(Gtk2::TreeViewColumnSizing)
integer = $tree_column->get_sort_column_idβ the sort column id, integer bestie.$tree_column->set_sort_column_id ($sort_column_id)β sets the sort column id.$sort_column_id(integer)
boolean = $tree_column->get_sort_indicatorβ boolean, is the sort indicator on.$tree_column->set_sort_indicator ($setting)β sets the sort indicator.$setting(boolean)
sorttype = $tree_column->get_sort_orderβ returns asorttype(aGtk2::SortType).$tree_column->set_sort_order ($order)β sets the sort order.$order(Gtk2::SortType)
integer = $tree_column->get_spacingβ spacing, integer, you know the drill.$tree_column->set_spacing ($spacing)β sets the spacing.$spacing(integer)
string = $tree_column->get_titleβ returns the title as a string.$tree_column->set_title ($title)β sets the title.$title(string)
widget or undef = $tree_column->get_tree_viewβ Since: gtk+ 2.12 πboolean = $tree_column->get_visibleβ is it visible? boolean.$tree_column->set_visible ($visible)β sets visibility.$visible(boolean)
widget or undef = $tree_column->get_widgetβ widget or undef, your call.$tree_column->set_widget ($widget)β sets the widget.$widget(Gtk2::Widget or undef)
integer = $tree_column->get_widthβ the width. integer. slay.
π PROPERTIES π
every single one of these is readable / writable / private / static-nick / static-blurb unless it says otherwise. iykyk.
'alignment'(float : default 0 : readable / writable / private / static-nick / static-blurb) β X Alignment of the column header text or widget'clickable'(boolean : default false : readable / writable / private / static-nick / static-blurb) β Whether the header can be clicked'expand'(boolean : default false : readable / writable / private / static-nick / static-blurb) β Column gets share of extra width allocated to the widget'fixed-width'(integer : default 1 : readable / writable / private / static-nick / static-blurb) β Current fixed width of the column'max-width'(integer : default -1 : readable / writable / private / static-nick / static-blurb) β Maximum allowed width of the column'min-width'(integer : default -1 : readable / writable / private / static-nick / static-blurb) β Minimum allowed width of the column'reorderable'(boolean : default false : readable / writable / private / static-nick / static-blurb) β Whether the column can be reordered around the headers'resizable'(boolean : default false : readable / writable / private / static-nick / static-blurb) β Column is user-resizable'sizing'(Gtk2::TreeViewColumnSizing : default "grow-only" : readable / writable / private / static-nick / static-blurb) β Resize mode of the column'sort-column-id'(integer : default -1 : readable / writable / private / static-nick / static-blurb) β Logical sort column ID this column sorts on when selected for sorting'sort-indicator'(boolean : default false : readable / writable / private / static-nick / static-blurb) β Whether to show a sort indicator'sort-order'(Gtk2::SortType : default "ascending" : readable / writable / private / static-nick / static-blurb) β Sort direction the sort indicator should indicate'spacing'(integer : default 0 : readable / writable / private / static-nick / static-blurb) β Space which is inserted between cells'title'(string : default "" : readable / writable / private / static-nick / static-blurb) β Title to appear in column header'visible'(boolean : default true : readable / writable / private / static-nick / static-blurb) β Whether to display the column'widget'(Gtk2::Widget : default undef : readable / writable / private / static-nick / static-blurb) β Widget to put in column header button instead of column title'width'(integer : default 0 : readable / private / static-nick / static-blurb) β Current width of the column
ngl, peep that 'width' one β it's readable but not writable. it said what it said. π
π¦ SIGNALS π¦
clicked(Gtk2::TreeViewColumn)
β ENUMS AND FLAGS β
enum Gtk2::SortType
'ascending'/GTK_SORT_ASCENDING'descending'/GTK_SORT_DESCENDING
enum Gtk2::TreeViewColumnSizing
'grow-only'/GTK_TREE_VIEW_COLUMN_GROW_ONLY'autosize'/GTK_TREE_VIEW_COLUMN_AUTOSIZE'fixed'/GTK_TREE_VIEW_COLUMN_FIXED
π SEE ALSO π
go read these too bestie, they're all connected:
Gtk2Glib::ObjectGlib::InitiallyUnownedGtk2::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 fr fr π«Ά this was perl v5.42.0, dated 2025-07-25, and yes the header/footer tried to abbreviate the name as Gtk2::T...wColumn(3) because it's extra like that. ate and left no crumbs. bye bestie!! πβ¨
π¦ 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