1Gtk2(3) User Contributed Perl Documentation Gtk2(3)
2
3
4
6 Gtk2 - Perl interface to the 2.x series of the Gimp Toolkit library
7
9 use Gtk2 -init;
10 # Gtk2->init; works if you didn't use -init on use
11 my $window = Gtk2::Window->new ('toplevel');
12 my $button = Gtk2::Button->new ('Quit');
13 $button->signal_connect (clicked => sub { Gtk2->main_quit });
14 $window->add ($button);
15 $window->show_all;
16 Gtk2->main;
17
19 Perl bindings to the 2.x series of the Gtk+ widget set. This module
20 allows you to write graphical user interfaces in a Perlish and object-
21 oriented way, freeing you from the casting and memory management in C,
22 yet remaining very close in spirit to original API.
23
25 The Gtk2 module allows a Perl developer to use the Gtk+ graphical user
26 interface library. Find out more about Gtk+ at http://www.gtk.org.
27
28 The GTK+ Reference Manual is also a handy companion when writing Gtk
29 programs in any language. http://developer.gnome.org/doc/API/2.0/gtk/
30 The Perl bindings follow the C API very closely, and the C reference
31 documentation should be considered the canonical source.
32
33 To discuss gtk2-perl, ask questions and flame/praise the authors, join
34 gtk-perl-list@gnome.org at lists.gnome.org.
35
36 Also have a look at the gtk2-perl website and sourceforge project page,
37 http://gtk2-perl.sourceforge.net
38
40 use Gtk2 qw/-init/;
41 use Gtk2 qw/-init -threads-init/;
42
43 -init
44 Equivalent to Gtk2->init, called to initialize GLIB and GTK+. Just
45 about every Gtk2-Perl script should do "use Gtk2 -init"; This
46 initialization should take place before using any other Gtk2
47 functions in your GUI applications. It will initialize everything
48 needed to operate the toolkit and parses some standard command line
49 options. @ARGV is adjusted accordingly so your own code will never
50 see those standard arguments.
51
52 -threads-init
53 Equivalent to Gtk2::Gdk::Threads->init, called to initialze/enable
54 gdk's thread safety mechanisms so that gdk can be accessed from
55 multiple threads when used in conjunction with
56 Gtk2::Gdk::Threads->enter and Gtk2::Gdk::Threads->leave. If invoked
57 as Gtk2::Gdk::Threads->init it should be done before Gtk2->init is
58 called, if done by "use Gtk2 -init -threads-init" order does not
59 matter.
60
62 Gtk2 exports nothing by default, but some constants are available upon
63 request.
64
65 Tag: constants
66 GTK_PRIORITY_RESIZE
67
68 GTK_PATH_PRIO_LOWEST
69 GTK_PATH_PRIO_GTK
70 GTK_PATH_PRIO_APPLICATION
71 GTK_PATH_PRIO_THEME
72 GTK_PATH_PRIO_RC
73 GTK_PATH_PRIO_HIGHEST
74
75 GDK_PRIORITY_EVENTS
76 GDK_PRIORITY_REDRAW
77 GDK_CURRENT_TIME
78
79 See Glib for other standard priority levels.
80
82 perl(1), Glib(3pm), Pango(3pm).
83
84 Gtk2::Gdk::Keysyms(3pm) contains a hash of key codes, culled from
85 gdk/gdkkeysyms.h
86
87 Gtk2::api(3pm) describes how to map the C API into Perl, and some of
88 the important differences in the Perl bindings.
89
90 Gtk2::Helper(3pm) contains stuff that makes writing Gtk2 programs a
91 little easier.
92
93 Gtk2::SimpleList(3pm) makes the GtkListStore and GtkTreeModel a lot
94 easier to use.
95
96 Gtk2::Pango(3pm) exports various little-used but important constants
97 you may need to work with pango directly.
98
99 Gtk2::index(3pm) lists the autogenerated api documentation pod files
100 for Gtk2.
101
102 Gtk2 also provides code to make it relatively painless to create Perl
103 wrappers for other GLib/Gtk-based libraries. See Gtk2::CodeGen,
104 ExtUtils::PkgConfig, and ExtUtils::Depends. If you're writing
105 bindings, you'll probably also be interested in Gtk2::devel, which is a
106 supplement to Glib::devel and Glib::xsapi. The Binding Howto, at
107 http://gtk2-perl.sourceforge.net/doc/binding_howto.pod.html, ties it
108 all together.
109
111 The gtk2-perl team:
112
113 muppet <scott at asofyet dot org>
114 Ross McFarland <rwmcfa1 at neces dot com>
115 Torsten Schoenfeld <kaffeetisch at web dot de>
116 Marc Lehmann <pcg at goof dot com>
117 Göran Thyni <gthyni at kirra dot net>
118 Jörn Reder <joern at zyn dot de>
119 Chas Owens <alas at wilma dot widomaker dot com>
120 Guillaume Cottenceau <gc at mandrakesoft dot com>
121
123 Copyright 2003-2011 by the gtk2-perl team.
124
125 This library is free software; you can redistribute it and/or modify it
126 under the terms of the GNU Library General Public License as published
127 by the Free Software Foundation; either version 2 of the License, or
128 (at your option) any later version.
129
130 This library is distributed in the hope that it will be useful, but
131 WITHOUT ANY WARRANTY; without even the implied warranty of
132 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
133 Library General Public License for more details.
134
135 You should have received a copy of the GNU Library General Public
136 License along with this library; if not, write to the Free Software
137 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
138 02110-1301 USA.
139
140
141
142perl v5.28.0 2017-04-21 Gtk2(3)