Gtk2::E...tonGroup(3)

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

πŸ’– Gtk2::E...tonGroup(3) πŸ’–

okay bestie, welcome to the glow-up zone of the manual pages β€” this is the user-contributed Perl doc for Gtk2::E...tonGroup(3), and we are gonna make it make sense. no cap.


✨ NAME ✨

Gtk2::Ex::FormFactory::CheckButtonGroup β€” a whole group of checkbuttons, slay


🌸 SYNOPSIS 🌸

Gtk2::Ex::FormFactory::CheckButtonGroup->new (
  max_columns        => Maximum number of columns,
  max_rows           => Maximum number of rows,
  column_labels      => Array of column label strings,
  row_labels         => Array of row label strings,

  attr_max_columns   => Object attribute for number of columns,
  attr_max_rows      => Object attribute for number of rows,
  attr_column_labels => Object attribute for column labels,
  attr_row_labels    => Object attribute for row labels,

  homogeneous        => Force homogeneous layout of underlying table?
  ...
  Gtk2::Ex::FormFactory::Widget attributes
);

πŸ¦‹ DESCRIPTION πŸ¦‹

So this class is literally a group of check buttons, and the whole point is letting you pick multiple things out of a set of predefined values. Not one, not two β€” multiple. It's giving "choose your faves" energy.

It lays itself out in a two dimensional table. You get to specify either the maximum number of rows or the maximum number of columns β€” pick one, bestie β€” and the actual dimensions just get calculated automatically for you. no stress, the math is handled.

Optionally you can add column labels and/or row labels, which extends the corresponding table accordingly. cute, right?

And here's the serve: you can pass the config data statically, or you can specify application object attributes that control it, so the checkbutton group builds dynamically at runtime. flexible queen behavior.

The value of a CheckBoxGroup is a hash. Every selected checkbox becomes a corresponding hash key, with a true value assigned to it. that's it, that's the whole vibe. πŸ’…


πŸ‘‘ OBJECT HIERARCHY πŸ‘‘

Gtk2::Ex::FormFactory::Intro

Gtk2::Ex::FormFactory::Widget
+--- Gtk2::Ex::FormFactory::CheckButtonGroup

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

⭐ ATTRIBUTES ⭐

Okay so attributes get handled through the common get_ATTR(), set_ATTR() style accessors β€” you know the drill. But fr fr, they're mostly passed once to the object constructor and then must not be altered after the associated FormFactory was built. Like, once it's built, it's built. don't touch. 🫢

  • max_columns = SCALAR [optional] β€” the max number of columns the table should have. and like, you must not set max_rows when you specify max_columns. one or the other, babe, not both.
  • max_rows = SCALAR [optional] β€” the max number of rows the table should have. you must not set max_columns when you specify max_rows. and if you omit both of these attributes? max_rows defaults to 1, so all the buttons show up in one single row. a little conga line of checkboxes. iconic.
  • column_labels = ARRAY [optional] β€” you can add column labels by setting an array of strings to the column_labels attribute. the number of entries should correspond to the max_columns setting. keep them matched, bestie.
  • row_labels = ARRAY [optional] β€” you can add row labels by setting an array of strings to the row_labels attribute. the number of entries should correspond to the max_rows setting. same energy, different axis.
  • attr_max_columns = "object.attr" [optional] β€” as an alternative to max_columns, the max number of columns may be controlled by an application object attribute, which needs to be passed here in "object.attr" notation. the dynamic version, if you will.
  • attr_max_rows = "object.attr" [optional] β€” as an alternative to max_rows, the max number of rows may be controlled by an application object attribute, passed here in "object.attr" notation. runtime realness.
  • attr_column_labels = "object.attr" [optional] β€” as an alternative to column_labels, the column labels may be controlled by an application object attribute, passed here in "object.attr" notation. yes queen, labels on the fly.
  • attr_row_labels = "object.attr" [optional] β€” as an alternative to row_labels, the row labels may be controlled by an application object attribute, passed here in "object.attr" notation. row labels, but make it dynamic.
  • homogeneous = BOOL [optional] β€” defaults to 1, which forces the underlying table into homogeneous layout. equal treatment for all the cells. βš–οΈ

πŸŽ€ REQUIREMENTS FOR ASSOCIATED APPLICATION OBJECTS πŸŽ€

So listen β€” application objects represented by a Gtk2::Ex::FormFactory::CheckButtonGroup must define additional methods. Not optional. The naming of the methods listed below uses the standard get_ prefix for the attribute read accessor, and ATTR needs to be replaced by the actual name of the attribute associated with the widget. iykyk.

  • get_ATTR_list β€” this method must return a two dimensional array, aka a list of lists, which represents the values the user can select from.

Example:

[
  [ 0, "Sun" ],
  [ 1, "Mon" ],
  [ 2, "Tue" ],
  ...
]

Each entry in the list consists of a list ref with two elements. The first is the value associated with the checkbox (which will become a hash key in the associated object attribute), and the second is the label of the checkbox on the GUI. value + label = the whole package.

For more attributes refer to Gtk2::Ex::FormFactory::Widget. go check that one out too, bestie.


🌈 AUTHORS 🌈

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

shoutout to JΓΆrn, the actual main character here. πŸ‘‘


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.

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.

⚠️ okay so it literally says "WITHOUT ANY WARRANTY" in all caps and I need you to feel that. no promises, no guarantees. that's the deal.

πŸ’€ POD ERRORS πŸ’€

Hey! The above document had some coding errors, which are explained below:

Around line 379:

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

not the pod errors catching strays 😭 it's just the â in Jârn doing its little thing, the parser assumed UTF-8 and honestly? fair.


and that's a wrap on the checkbutton group, bestie. this page came to you courtesy of perl v5.42.0, dated 2025-07-25, and it lives under Gtk2::E...tonGroup(3). go build something cute with it. mwah. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from