Gtk2::ColorButton(3)
π NAME π
Gtk2::ColorButton β bestie, it's literally just a wrapper for GtkColorButton. That's it, that's the whole vibe. She's a button, you click her, she lets you pick a color. Iconic behavior tbh. π¨β¨
(Oh and for the record, this whole thing lives in the User Contributed Perl Documentation section of the manual, in case you were wondering where you found her.)
π¦ HIERARCHY π¦
The family tree, and yes she comes from a long line of distinguished ancestors, it's giving generational wealth:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Bin
+----Gtk2::Button
+----Gtk2::ColorButton
No cap, she is a Gtk2::Button at heart. Just a button with range. π
β¨ INTERFACES β¨
She's got her certifications, her little badges, her extracurriculars:
Glib::Object::_Unregistered::AtkImplementorIfaceGtk2::BuildableGtk2::Activatable
πΈ METHODS πΈ
Okay so this is the part you actually came here for. Sit down, hydrate, let's go. π
π Constructors π
widget = Gtk2::ColorButton->new ($color=undef)β makes you a fresh color button. Takes an optional:$colorβ aGtk2::Gdk::Color. Leave it out and it'sundef, nbd.
widget = Gtk2::ColorButton->new_with_color ($color=undef)β same energy, but like, with color. Also takes:$colorβ aGtk2::Gdk::Color. Defaults toundef.
π§ Alpha stuff π§
unsigned = $color_button->get_alphaβ tells you the current alpha value. Unsigned, so don't come at her with negative numbers.$color_button->set_alpha ($alpha)β sets the alpha. Takes:$alphaβ anunsigned.
π Color stuff π
color = $color_button->get_colorβ hands you back the color. A wholeGtk2::Gdk::Color. Slay.$color_button->set_color ($color)β sets the color. Takes:$colorβ aGtk2::Gdk::Color.
π Title stuff π
string = $color_button->get_titleβ the title of the color selection dialog, but as a string, obvs.$color_button->set_title ($title)β renames the dialog. Takes:$titleβ astring.
π Use-alpha stuff π
boolean = $color_button->get_use_alphaβ is alpha even on? Returns a boolean, so true or false, pick a lane.$color_button->set_use_alpha ($use_alpha)β toggles alpha usage. Takes:$use_alphaβ aboolean.
π PROPERTIES π
The β¨aestheticβ¨ configuration, with all the flags she comes with:
'alpha'(Glib::UInt: default65535: readable / writable / private / static-nick / static-blurb) β The selected opacity value (0 fully transparent, 65535 fully opaque)'color'(Gtk2::Gdk::Color: defaultundef: readable / writable / private / static-nick / static-blurb) β The selected color'title'(string: default"Pick a Color": readable / writable / private / static-nick / static-blurb) β The title of the color selection dialog'use-alpha'(boolean: defaultfalse: readable / writable / private / static-nick / static-blurb) β Whether or not to give the color an alpha value
π₯ SIGNALS π₯
color-set(Gtk2::ColorButton)
That's the one. When the color gets set, she tells you. Main character energy fr fr. π£
π SEE ALSO π
The whole friend group, go say hi:
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::Button
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
okay bestie that's the whole page, you're officially educated π This was documented with perl v5.42.0, dated 2025-07-25, and yeah β Gtk2::ColorButton(3), that's her full name, put some respect on it. π«Ά Go pick a cute color, you've earned it. π¨β¨πΈ
π¦ 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