Gtk2-perl
From Wikipedia, the free encyclopedia
This article may not meet the general notability guideline or one of the following specific guidelines for inclusion on Wikipedia: Biographies, Books, Companies, Fiction, Music, Neologisms, Numbers, Web content, or several proposals for new guidelines. If you are familiar with the subject matter, please expand or rewrite the article to establish its notability. The best way to address this concern is to reference published, third-party sources about the subject. If notability cannot be established, the article is more likely to be considered for redirection, merge or ultimately deletion, per Wikipedia:Guide to deletion. This article has been tagged since February 2008. |
GTK2-Perl is a set of Perl wrappers for the GTK+ GUI library and the other GNOME platform libraries. GTK2-Perl is free software and licensed under the LGPL. 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[1], along with C++ bindings, Python bindings and Java bindings.
[edit] 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.