[4] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

Re: anyone here yet?

daemon@ATHENA.MIT.EDU (Owen Taylor)
Thu May 1 19:07:47 1997

To: gtk-list@redhat.com
From: Owen Taylor <owt1@cornell.edu>
Date: 01 May 1997 19:08:09 -0400
In-Reply-To: Otto Hammersmith's message of Thu, 1 May 1997 16:06:25 -0400
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com


What I've been working on recently is a Perl interface to
gtk. It's not quite ready for release yet, but I have a
good chunk done. (A Perl port of the entire testgtk program
works stably in Perl.) As a teaser, 'simple.c' in Perl follows.

You can see that by mapping gtk's object oriented design onto
the objected oriented features of Perl, I've been able to make
the interface considerably more concise.

The clean design of gtk really made programming the interface
quite easy. I hope people will find it useful, at the least for
creating quick interfaces.

                                        Owen

-------
#!/usr/bin/perl -w

use Gtk;

Gtk::init ($0,\@ARGV);

my $window = Gtk::window('toplevel');
$window->connect("destroy", sub { Gtk::exit(0) });
$window->border_width(10);

my $button = Gtk::button_with_label("Hello World");
$button->connect("clicked", sub { print "Hello World\n"; Gtk:exit(0) });
$window->add($button);

$button->show;
$window->show;

Gtk::main();



--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post