Gtk2-Perl

{{notability|Products|date=April 2016}}

{{Infobox software

| name = Gtk-Perl

| title = Gtk2-Perl and Gtk3-Perl

| logo =

| logo caption =

| logo_size =

| logo_alt =

| screenshot =

| caption =

| screenshot_size =

| screenshot_alt =

| collapsible =

| author =

| developer =

| released =

| discontinued =

| latest release version = Gtk2: 1.24.92b
Gtk3:v0.017

| latest release date = {{Start date and age|2014|07|03}}
{{Start date and age|2014|07|03}}

| latest preview version =

| latest preview date =

| programming language = Perl

| operating system =

| size =

| language =

| language count =

| language footnote =

| genre = Language binding

| license = GNU Lesser General Public License 2.1

| website = {{URL|http://gtk2-perl.sourceforge.net/}}

}}

{{Main|List of language bindings for GTK}}

Gtk2-Perl is a set of wrappers for the Perl programming language around the GTK and further GNOME libraries. Gtk-Perl is free and open-source software licensed under the GNU Lesser General Public License (LGPL) version 2.1. Developers and interested parties can usually be found on the IRC channel #gtk-perl on irc.gnome.org.

Gtk2-Perl is part of the official GNOME Platform Bindings release.[https://wiki.gnome.org/TwoPointFifteen/Bindings TwoPointFifteen/Bindings - GNOME Wiki]

Example

use Gtk2 '-init';

$window = Gtk2::Window->new('toplevel');

$window->set_title("Hello World!");

$button = Gtk2::Button->new("Press me");

$button->signal_connect(clicked => sub { print "Hello again - the button was pressed\n"; });

$window->add($button);

$window->show_all;

Gtk2->main;

0;

The sample program creates a GTK Window titled "Hello World!". The window contains a Button labelled "Press me." When the button is pressed, the message "Hello again - the button was pressed" is displayed on the console via the callback inside the anonymous subroutine connected to the "clicked" signal.

References

{{reflist}}