Gtk2::GC(3)

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

πŸ’… 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 (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