Re: GTK2, XML, perl



On Sun, 2006-03-12 at 22:04 -0400, Josà Luis Regalado wrote: 
Glade generate a file called by example: foo.glade. It is possible to 
happen of foo.glade to foo.pl?, it is to say, XML to perl code?

That would mean that you could not go back to Glade and revise your user
interface.  If you did, and re-generated foo.pl, you would lose all the
changes you'd made.

It is better to keep your user interface and your logic separate.

A useful technique is to create a Perl class and using Glade, connect
signal handlers to method calls against an object of that class.  Such a
technique is described in this tutorial:

  http://live.gnome.org/GTK2-Perl/GladeXML/Tutorial

You might find it useful to generate the outline of this class using a
script that reads the .glade file and generates a .pm file.  However, if
you later add signal handlers to the glade definition, you'll need to
add the methods manually to the .pm file.

Marco Antonio Manzo's Gtk2::GladeXML::Simple module includes a script
called gpsketcher that can create an initial .pm file for you:

  http://search.cpan.org/dist/Gtk2-GladeXML-Simple/

Regards
Grant




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