Clever Geek Handbook
📜 ⬆️ ⬇️

Gtk2-perl

GTK2-Perl is a set of Perl wrappers for the GTK + GUI libraries and other GNOME libraries. GTK2-Perl is an open source software licensed under the LGPL license. Developers and stakeholders can usually be found on the # gtk-perl IRC channel on irc.gnome.org.

GTK2-Perl is part of the official GNOME Platform Bindings [1] release, along with interfaces to C ++ , Python, and Java .

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 ;

In this example, a GTK + Window with the title “Hello World!”. The window contains a Button labeled “Press me." When the user presses the button, the callback function associated with the cliked signal of the button is called. This function displays the message "Hello again - the button was pressed" to the console. It should be noted that in this case the callback function is anonymous (does not have a name) and is declared directly in the call arguments of the signal_connect function, which connects the signals and callback functions specified by the user.

Links

  1. ↑ TwoPointFifteen / Bindings - GNOME Live!

External links

  • GTK2-Perl homepage on SourceForge.net
  • GTK2-Perl page on the GNOME wiki
Source - https://ru.wikipedia.org/w/index.php?title=Gtk2-perl&oldid=53466642


More articles:

  • Muraro, Roger
  • Fevrier, Jacques
  • Lautarius
  • Kablukov, Vladimir Ivanovich
  • Iraq National Football Team
  • Horemheb
  • Colon (Theater)
  • Post Traumatic Stress Disorder
  • Inspector Clouseau
  • Hemmond, David

All articles

Clever Geek | 2019