Re: [gtk-list] Re: Perl/Gtk 0.1.15 uploaded to ftp.gimp.org and CPAN



On Thu, Mar 26, 1998 at 12:18:16AM -0600, Jason L Tibbitts III wrote:
> KA> [...] release 0.1.15 of my Gtk module for Perl has been uploaded [...]
> 
> Can anyone comment on the usability of this package for medium-size
> application development?  I am considering using it to write a local GUI
> interface for the new Majordomo (thus Perl is a requirement) and I'm
> willing to hack as long as things are reasonably stable.  I don't have

It's pretty stable, modulo bugs in gtk+ itself:-)
It needs testing of some widgets, though, and of some new feautures
recently added. test.pl (the companion of testgtk.c) and the applications
I built with it work fairly well.

> I haven't been able to grab the latest version (it's not yet at gtk.org)
> but 0.1.14 didn't seem to have much in the way of documentation.  Is this a
> serious hindrance or do things basically mirror the C examples in the GTK
> tutorial?

If you have the time please contribute the documentation:-)
For examples of usage look at the test.pl code.
The main differences with the C api are:
	* OO interface, ie:
		$window = new Gtk::Window('toplevel');
		$window->show;
	  instead of 
	  	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	  	gtk_widget_show(window);
	* Handling of flags and enums: in perl you use strings such as
	  'toplevel' instead of GTK_WINDOW_TOPLEVEL for enums and 
	  ['fill', 'expand'] instead of GTK_FILL| GTK_EXPAND for flags.
	  This values come from the gtk.defs file.
	* You don't need all that casting macros:-)
	* You don't have access to glib: use perl data structures instead.
	* Some minor interface change where the 'Perl way' is better, such
	  as when returning multiple values.
	* When you singal_connect() you can pass as many values you want:
	  	$button->signal_connect('clicked', \&foo, $bar, [$baz]);
	  and you can use closures:
	  	$button->signal_connect('clicked', sub {do_something});
	* Gtk objects are hash refs, so you can store anything in them:
		$button->{'foo'} = 'bar';
	* You can derive your own widget:
		package Foo:;
		@ISA = qw{Gtk::Button};
		...


lupus



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]