- Gtk2-perl
GTK2-Perl is a set of
Perl wrapper s for theGTK+ GUI library and the otherGNOME platform libraries. GTK2-Perl isfree software and licensed under theLGPL . 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 [ [http://live.gnome.org/TwoPointFifteen/Bindings TwoPointFifteen/Bindings - GNOME Live! ] ] , along with C++ bindings, Python bindings and Java bindings.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 "; });
$window->add($button);$window->show_all;
Gtk2->main;
0;
The sample program creates a GTK+
Window
titled "Hello World!". The window contains aButton
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 anonymoussubroutine connected to the "clicked" signal.References
External links
* [http://gtk2-perl.sourceforge.net/ GTK2-Perl homepage on SourceForge.net]
* [http://live.gnome.org/GTK2-Perl GTK2-Perl page on GNOME wiki]
Wikimedia Foundation. 2010.