Gtk2::GC(3)
π NAME π
Gtk2::GC β bestie, it's the shared pool of graphics contexts, and we're gonna talk about it π
(Also it's a page from the User Contributed Perl Documentation, so you know it's the people's documentation, fr fr.)
β¨ DESCRIPTION β¨
Okay so listen π«Ά these functions give you access to a shared pool of Gtk2::Gdk::GC objects. The way it works is literally so simple:
When a new Gtk2::Gdk::GC is needed, Gtk2::Gdk::GC::get gets called with the required depth, colormap and Gtk2::Gdk::GCValues. If a Gtk2::Gdk::GC with the required properties already exists, then that one gets returned β no new one, we're recycling, we love sustainability π. If not? A brand new Gtk2::Gdk::GC is created. Slay.
[From: <http://developer.gnome.org/doc/API/2.0/gtk/gtk-Graphics-Contexts.html>]
π¦ HIERARCHY π¦
Look at this family tree, it's giving lineage π
Glib::Object
+----Gtk2::Gdk::GC
+----Gtk2::GC
πΈ METHODS πΈ
gc = Gtk2::GC->get ($depth, $colormap, $values)
Here's the main character method, and here's what you're feeding it π:
$depth(integer) β just an integer bestie$colormap(Gtk2::Gdk::Colormap) β a colormap, iconic$values(Gtk2::Gdk::GCValues) β the Values to match π
Now, $values is a hashref with keys and values as per "Gtk2::Gdk::GC->new" (go peek at Gtk2::Gdk::GC for the deets, iykyk).
π Compatibility π
Not me having to deliver the lore, but here we go:
Before version 1.200 of the Gtk2 perl module, it was necessary to call Gtk2::GC::release() on GCs obtained from Gtk2::GC::get(). As of version 1.200, this is no longer necessary β a GC will be released when the last perl reference goes away. Cleanup handles itself now, we love an independent queen β¨
Old-style code continues to work, but Gtk2::GC::release() is deprecated. So it still runs, it's just not the vibe anymore. π
π SEE ALSO π
Gtk2β go read it, bestie π«Ά
π 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, periodt π This lil' rewrite was brought to you by perl v5.42.0, dated 2025-07-25 β mwah, take care of yourself, drink water, and go release your GCs (or don't, they do it themselves now π) π§π
π¦ 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