turo has asked for the wisdom of the Perl Monks concerning the following question:

These days i've played a lot with Gtk2 ... I remember i said some time ago, that i didn't like to program GUIs, because of the tedious and you must write an enourmous program for getting what you want ...
I think, i was no fully right then, because learning is anything but tedious (curiosity needs to eat ... whatever you feed) ...
That is, Gtk2 for perl, is like an adventure for me and I suppose I will be charmed by this Library during a long time from now... But, like love, it will turn tedious soon.

So i'm thinking in the next stage: how can I automate this task?
I mean, there is any tool (like Glade) for linux to generate perl code, or even better to generate XML code (Something like XUL, or the resources used by C#) which can be compiled and interpreted for generate widgets? ... Some of you, my ($fellowship, $brothers), knows how to do this task with an impartial tool (linux, windows)?

It would be funny, to implement some perl platform independent library (i've heard that GTK2 is supported under windows) for build GUIS using a simple XML spec on the fly; if it not exists.
and
to program an ide (platform independent tool) for generating this XML :-) (something like, extending the mason tags for make widgets) (uff, i've remembered that there is a tool called entity to do the first task (from XML to Code), ... but i never used)

some ideas?, thoughts?, some voluntaries to make a crazy tool for doing this task?

At the moment, this weekend i swear i'll study the Gtk2 specs ...

Cheers

turo

perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'

Replies are listed 'Best First'.
Re: XUL, Gtk2, Perl and other thoughts
by phaylon (Curate) on Feb 17, 2006 at 19:41 UTC
    Well, from http://glade.gnome.org/

    "By using libglade, Glade XML files can be used in numerous programming languages including C, C++, Java, Perl, Python, C#, Pike, Ruby, Haskell, Objective Caml and Scheme."

    And for Perl there would Gtk2-GladeXML. Though, I've never used any of those. Was just a quick lookup.

    Ordinary morality is for ordinary people. -- Aleister Crowley
Re: XUL, Gtk2, Perl and other thoughts
by zentara (Cardinal) on Feb 17, 2006 at 22:17 UTC
    Check out the "gpsketcher" script in Gtk2-GladeXML-Simple. It will take a sample Glade XML file, and sketch it out to a .pl file. It could be the basis for making a high level glade gui designer.

    I'm not really a human, but I play one on earth. flash japh
Re: XUL, Gtk2, Perl and other thoughts
by Aristotle (Chancellor) on Feb 20, 2006 at 03:31 UTC

    You don’t want to generate code. You really don’t want to generate code. Repetition is the bane of programming. You want to abstract it away, not make it more efficient by making the computer do the typing for you.

    Indeed, the code generation stuff in Glade is deprecated.

    The recommended usage for Glade2 is to link against libglade (ie Gtk2::GladeXML in Perl) and load the XML files at runtime. You can then access widgets by the names you gave them in the Glade2 GUI editor.

    Makeshifts last the longest.

      Abstract and Automate, both are nice words :-)

      perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'
Re: XUL, Gtk2, Perl and other thoughts
by turo (Friar) on Feb 18, 2006 at 13:10 UTC

    Seems like the Glade project has become a real GUI development tool (i have tried it a lot of time ago (5 years, i think, for programming a gui for an ADA95 program)).
    phaylon, zentara, this sound really good.

    But it will be better if the XML generated by Glade were a kind of standard for making GUIs ... I thought XUL were the same, but more standard ...

    perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'