1Gtk2::version(3) User Contributed Perl Documentation Gtk2::version(3)
2
3
4
6 Gtk2::version - Library Version Information
7
9 use Gtk2 '1.023'; # require at least version 1.023 of the bindings
10
11 if ($Gtk2::VERSION >= 1.040 and Gtk2->CHECK_VERSION (2, 4, 0)) {
12 # the GtkFileChooser, new in gtk+ 2.4.0 and first supported in
13 # Gtk2-Perl at 1.040, is available
14 } else {
15 # GtkFileChooser is not available, fall back to GtkFileSelection
16 }
17
19 Since the Gtk2 Perl module is a bridge to an external library with its
20 own versions and API revisions, we have three different versions
21 available for inspection. Which one you need to use at which time
22 depends entirely on the situation. Gtk2 uses the same scheme as Glib
23 and the underlying gtk+ C library; that is, the standard $Gtk2::VERSION
24 for the version of the bindings, all-caps (MAJOR|MINOR|MICRO)_VERSION
25 functions for the bound version, and lower-case
26 (major|minor|micro)_version functions for the runtime version. See
27 Glib::version and
28 <http://developer.gnome.org/doc/API/2.0/gtk/gtk-Feature-Test-Macros.html>
29 for more information.
30
31 Note also that gtk_check_version() and GTK_CHECK_VERSION() have
32 different semantics in C, and we have preserved those faithfully.
33
35 boolean = Gtk2->CHECK_VERSION ($required_major, $required_minor,
36 $required_micro)
37 · $required_major (integer)
38
39 · $required_minor (integer)
40
41 · $required_micro (integer)
42
43 Provides a mechanism for checking the version information that Gtk2 was
44 compiled against. Essentially equvilent to the macro GTK_CHECK_VERSION.
45 In most cases this function should be used rather than check_version
46 ().
47
48 (MAJOR, MINOR, MICRO) = Gtk2->GET_VERSION_INFO
49 Shorthand to fetch as a list the gtk+ version for which Gtk2 was
50 compiled. See "Gtk2::MAJOR_VERSION", etc.
51
52 integer = Gtk2::MAJOR_VERSION
53 The major version of the gtk+ library against which Gtk2 was compiled.
54 Equivalent to gtk+'s GTK_MAJOR_VERSION.
55
56 integer = Gtk2::MICRO_VERSION
57 The micro version of the gtk+ library against which Gtk2 was compiled.
58 Equivalent to gtk+'s GTK_MICRO_VERSION.
59
60 integer = Gtk2::MINOR_VERSION
61 The minor version of the gtk+ library against which Gtk2 was compiled.
62 Equivalent to gtk+'s GTK_MINOR_VERSION.
63
64 string = Gtk2->check_version ($required_major, $required_minor,
65 $required_micro)
66 · $required_major (integer)
67
68 · $required_minor (integer)
69
70 · $required_micro (integer)
71
72 Returns undef if the version of gtk+ currently in use is compatible
73 with the given version, otherwise returns a string describing the
74 mismatch. Note that this is not the same logic as
75 "Gtk2::CHECK_VERSION". This check is not terribly reliable, and should
76 not be used to test for availability of widgets or functions in the
77 Gtk2 module --- use "Gtk2::CHECK_VERSION" for that. See Glib::version
78 for a more detailed description of when you'd want to do a runtime-
79 version test.
80
81 integer = Gtk2::major_version
82 The major version of the gtk+ library current in use at runtime.
83 Equivalent to gtk+'s global variable gtk_major_version.
84
85 integer = Gtk2::micro_version
86 The micro version of the gtk+ library current in use at runtime.
87 Equivalent to gtk+'s global variable gtk_micro_version.
88
89 integer = Gtk2::minor_version
90 The minor version of the gtk+ library current in use at runtime.
91 Equivalent to gtk+'s global variable gtk_minor_version.
92
93 (major, minor, micro) = Gtk2->get_version_info
94 Shorthand to fetch as a list the gtk+ version against which Gtk2 is
95 linked. See "Gtk2::major_version", etc.
96
98 Gtk2, Glib::version
99
101 Copyright (C) 2003-2011 by the gtk2-perl team.
102
103 This software is licensed under the LGPL. See Gtk2 for a full notice.
104
105
106
107perl v5.28.1 2019-02-02 Gtk2::version(3)