Gtk2::T...wColumn(3)

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

πŸ’– 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::CellLayout
  • Gtk2::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 a double.
  • $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 $func as the callback that gets used whenever $column needs to set up $cell to render a cell. $func should 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 a treeviewcolumnsizing (that's a Gtk2::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 a sorttype (a Gtk2::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:

  • Gtk2
  • Glib::Object
  • Glib::InitiallyUnowned
  • Gtk2::Object

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