Gtk2::version(3)
π Gtk2::version β Library Version Information π
okay bestie, this is a section 3 page from the User Contributed Perl Documentation collection, and it's all about figuring out which version of gtk+ you're actually dealing with, because there are like three of them and they are not the same thing. no cap. π«Ά
β¨ SYNOPSIS β¨
use Gtk2 '1.023'; # require at least version 1.023 of the bindings
if ($Gtk2::VERSION >= 1.040 and Gtk2->CHECK_VERSION (2, 4, 0)) {
# the GtkFileChooser, new in gtk+ 2.4.0 and first supported in
# Gtk2-Perl at 1.040, is available
} else {
# GtkFileChooser is not available, fall back to GtkFileSelection
}
πΈ DESCRIPTION πΈ
so here's the tea: the Gtk2 Perl module is a bridge to an external library that has its own versions and its own API revisions, which means there are three different versions you can inspect. which one you reach for and when depends entirely on the situation, iykyk. π
Gtk2 runs the same scheme as Glib and the underlying gtk+ C library, meaning:
- the standard
$Gtk2::VERSIONgives you the version of the bindings - the all-caps
(MAJOR|MINOR|MICRO)_VERSIONfunctions give you the bound version - the lower-case
(major|minor|micro)_versionfunctions give you the runtime version
if you want more lore, go look at Glib::version and <http://developer.gnome.org/doc/API/2.0/gtk/gtk-Feature-Test-Macros.html>. π
also note bestie:gtk_check_version()andGTK_CHECK_VERSION()have different semantics in C, and we have preserved those faithfully. don't come for me, that's just how it is. π
π METHODS π
boolean = Gtk2->CHECK_VERSION ($required_major, $required_minor, $required_micro)
$required_major(integer)$required_minor(integer)$required_micro(integer)
gives you a mechanism for checking the version information that Gtk2 was compiled against. essentially equivalent to the macro GTK_CHECK_VERSION. in most cases you should be using this function rather than check_version (). periodt. β¨
(MAJOR, MINOR, MICRO) = Gtk2->GET_VERSION_INFO
shorthand that fetches, as a list, the gtk+ version for which Gtk2 was compiled. go see "Gtk2::MAJOR_VERSION", etc. π
integer = Gtk2::MAJOR_VERSION
the major version of the gtk+ library against which Gtk2 was compiled. equivalent to gtk+'s GTK_MAJOR_VERSION.
integer = Gtk2::MICRO_VERSION
the micro version of the gtk+ library against which Gtk2 was compiled. equivalent to gtk+'s GTK_MICRO_VERSION.
integer = Gtk2::MINOR_VERSION
the minor version of the gtk+ library against which Gtk2 was compiled. equivalent to gtk+'s GTK_MINOR_VERSION.
string = Gtk2->check_version ($required_major, $required_minor, $required_micro)
$required_major(integer)$required_minor(integer)$required_micro(integer)
returns undef if the version of gtk+ currently in use is compatible with the given version β otherwise it hands you back a string describing the mismatch. π¦
β οΈ heads up: this is not the same logic as"Gtk2::CHECK_VERSION". this check is not terribly reliable, and you should not use it to test whether widgets or functions are available in the Gtk2 module β use"Gtk2::CHECK_VERSION"for that, fr fr. if you wanna know when a runtime-version test is actually the move,Glib::versionhas the detailed breakdown.
integer = Gtk2::major_version
the major version of the gtk+ library currently in use at runtime. equivalent to gtk+'s global variable gtk_major_version. π
integer = Gtk2::micro_version
the micro version of the gtk+ library currently in use at runtime. equivalent to gtk+'s global variable gtk_micro_version. π
integer = Gtk2::minor_version
the minor version of the gtk+ library currently in use at runtime. equivalent to gtk+'s global variable gtk_minor_version. π
(major, minor, micro) = Gtk2->get_version_info
shorthand that fetches, as a list, the gtk+ version against which Gtk2 is linked. go see "Gtk2::major_version", etc. π§
π SEE ALSO π
Gtk2, Glib::version
π 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, bestie β you ate that π β¨
signing off from perl v5.42.0, dated 2025-07-25, page Gtk2::version(3) β mwah, love u, go check your versions π«Άπ
π¦ 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