Gtk2::E...ry::List(3)

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

πŸ’– Gtk2::Ex::FormFactory::List πŸ’–

okay so bestie, welcome to Gtk2::Ex::FormFactory::List β€” it's a whole List in the Gtk2::Ex::FormFactory framework, and it's part of the User Contributed Perl Documentation. yes the manual name is long, we're gonna say it a lot, hydrate first πŸ’…


✨ SYNOPSIS ✨

Gtk2::Ex::FormFactory::List->new (
  attr_select        => Attribute name for selection tracking,
  attr_select_column => Use this column's value to store in attr_select
  columns            => Titles of the list columns,
  types              => Types of the list columns,
  editable           => Which columns are editable?,
  visible            => Which columns are visible?
  selection_mode     => Selection mode of this list,
  no_header          => Omit header?
  update_selection_only => Boolean, whether updates should only
                           change the selection, not the list
                           of values,
  ...
  Gtk2::Ex::FormFactory::Widget attributes
);

like, that's the whole vibe. pass your stuff in at construction time, k? πŸŽ€


🌸 DESCRIPTION 🌸

This class implements a List inside a Gtk2::Ex::FormFactory framework β€” and it's based on Gtk2::Ex::Simple::List, for the record. πŸ“

Here's the tea though: the value of the associated application object attribute needs to be a reference to a two dimensional array with the content of the list. two dimensional. rows and columns. don't come at it with a flat array, it will not slay. πŸ™ˆ


πŸ¦‹ OBJECT HIERARCHY πŸ¦‹

the family tree, and yes we're all seated for it:

Gtk2::Ex::FormFactory::Intro

Gtk2::Ex::FormFactory::Widget
+--- Gtk2::Ex::FormFactory::List

Gtk2::Ex::FormFactory::Layout
Gtk2::Ex::FormFactory::Rules
Gtk2::Ex::FormFactory::Context
Gtk2::Ex::FormFactory::Proxy

see that +---? that's Gtk2::Ex::FormFactory::List descending from Gtk2::Ex::FormFactory::Widget. main character energy fr πŸ’«


πŸ‘‘ ATTRIBUTES πŸ‘‘

so attributes are handled through the common get_ATTR(), set_ATTR() style accessors β€” very standard, very demure. but here's the important part bestie: they're mostly passed once to the object constructor and must not be altered after the associated FormFactory was built. once it's built, it's built. periodt. 🚫

  • attr_select = SCALAR [optional] β€” wanna track the selection state of the List? drop the name of the attribute of the associated application object right here. then an array reference with the indicies of the selected rows (or specific column values, if attr_select_column is set) gets managed automatically and stored in that attribute. automatic. we love that for us. ✨
  • attr_select_column β€” normally indicies of the selected rows go into the attribute you passed with attr_select. but specify a column number here and the corresponding values get stored instead β€” like, say, an internal database ID hiding out in an invisible column. πŸ‘€ and if you do use this, you may also use the select_row_by_attr() method, which is described below. (yes, we get there, patience bb)
  • columns = ARRAYREF [mandatory] β€” a reference to an array containing the column titles of this list. mandatory, so don't skip it, it's not optional no matter how cute you are. πŸ’…
  • types = ARRAYREF [optional] β€” you may define types for the columns. the type of a column defaults to 'text'. other possible types are:
text    normal text strings
markup  pango markup strings
int     integer values
double  double-precision floating point values
bool    boolean values, displayed as toggle-able checkboxes
scalar  a perl scalar, displayed as a text string by default
pixbuf  a Gtk2::Gdk::Pixbuf

a pixbuf?? in my list column? iconic. πŸ–ΌοΈ

  • editable = ARRAYREF [optional] β€” an array reference of boolean values, one value for each column. changes to columns marked editable are synchronized automatically with the associated application object attribute. so you flip a checkbox, the object knows. no cap. πŸ”„
  • visible = ARRAYREF [optional] β€” an array reference of boolean values, one value for each column, controlling the visibility of the corresponding columns. default is to display all columns. all of them. the whole fit. 🌈
  • selection_mode = 'none'|'single'|'browse'|'multiple' [optional] β€” you may specify a selection mode for the list. please refer to the Gtk+ documentation of GtkSelectionMode for details about the possible selection modes. (go read it, i'm not gonna paraphrase gtk at you 🫢)
  • update_selection_only = BOOL [optional] β€” if you know the values of your list don't change at runtime, and only the actual selection matters, set this to a true value. why? because updating will be significantly faster, since only the actual selection is affected. free speed, bestie. take it. ⚑

for more attributes refer to Gtk2::Ex::FormFactory::Widget. that's where the rest of the lore lives. πŸ“š


πŸŽ€ METHODS πŸŽ€

  • $rows = $widget->get_selected_rows () β€” returns a list reference of selected row indicies. that's it, that's the method. simple, clean, ate. 🍽️
  • $data_lref = $widget->get_data () β€” returns the data array of the underlying Gtk2::SimpleList. it's a two dimensional array of rows and columns.
⚠️ real talk though: all manipulations affect the GUI immediately but bypass all Gtk2::Ex::FormFactory automatic object value update magic. so be careful with this. the sync will not save you here. πŸ’€
  • $widget->select_row_by_attr ($value) β€” selects a row by a given select_attr attribute value. works only if select_attr is set for this list. no select_attr, no selection. that's the deal. 🀝

πŸ’œ AUTHORS πŸ’œ

JΓΆrn Reder <joern at zyn dot de>

(one author, one legend, we stan 🫑)


Copyright 2004-2006 by JΓΆrn Reder.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU Library General Public License for more details. (yes the all-caps is doing the most, but it's legally doing the most 🫠)

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA.


πŸ› POD ERRORS πŸ›

hey! the above document had some coding errors, which are explained below:

Around line 402:

    Non-ASCII character seen before =encoding in 'JΓΆrn'. Assuming UTF-8

the â in Jârn said "i contain multitudes and also bytes" and perl was like "ok assuming UTF-8 then" 😭 not a bug in the list, a bug in the document. anyway.


and that's the whole page bestie!! you read all of it, i'm so proud, you're literally the main character of this manual now 🌟

this was Gtk2::E...ry::List(3) from the User Contributed Perl Documentation, generated with perl v5.42.0 and dated 2025-07-25 β€” mwah, go build something cute with it πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from