Gtk2Fu 0.10 review
DownloadGtk2Fu is a GTK2 Forked Ultimate, a powerful layer on top of Gtk2
|
|
Gtk2Fu is a GTK2 Forked Ultimate, a powerful layer on top of Gtk2. (forked from ugtk2.)
gtk2-fu is a layer on top of perl gtk2, that brings power, simplicity and speed of development. It brings additional methods to ease the widget creation among other things. But the most important feature is that it brings you a lot of derivated methods from existing methods, that does exactly the same thing, except that ir returns the widget. Example :
$window->set_title('foo'); #the normal method
$window->set_title_('foo'); #the gtk2-fu derivated method
set_title_ does the same things as set_title, but it returns $window.
What's the advantage? you can chain actions ! Look at the 2 code examples below :
# normal perl-gtk2
my $window = Gtk2::Window->new();
my $entry = Gtk2::Entry->new();
$entry->set_text('foo');
$entry->set_editable(0);
$window->add($entry);
# using gtk2-fu
my $window = Gtk2::Window->new();
$window->add(
Gtk2::Entry->new()
->set_text_('foo')
->set_editable_(0)
);
You could even get rid of the $window declaration. The gain can seem to you very minor, but in more complex cases, it allows you to create a complex GUI really easilly. You'll find a bigger example at the end of this documentation
In addition to this feature, gtk2-fu provides a toolbox of useful help methods to create widgets, ask things to the user, and misc other things.
Requirements:
Perl
Gtk2Fu 0.10 keywords