Re: (proposal for) source code generator
- From: Grischa Jacobs <grischa bitclown de>
- To: gtkmm-list gnome org
- Subject: Re: (proposal for) source code generator
- Date: Sat, 28 Jun 2008 14:32:02 +0200
Amadeus W.M. wrote:
<...>
To exemplify, suppose I have a trivial application with a top level window
with just a button in it that outputs "OK" to stdout when clicked. That's
the whole application. The gui part of the code for this would be as
follows:
class MainWindowGUI : public sigc::trackable
{
<...>
I don't know enough xml/xslt but I suspect this could be done by creating
an intelligent xslt file, say application.xsl, then generate the code with
an off-the-shelf xslt processor like so:
xsltproc application.xsl application.glade > MainWindowGUI.hh
Thus, one would not have to write massive amounts of code to parse the
xml .glade file and generate the C++ code from it. All that would need to
be written (not by me though) would be a one-time xslt file (transform).
We're too using glade--, despite the claim that a majority of the
developer would prefer libglade. Nice to see that I'm not the last of
its kind. Just two questions.
I was wondering whether Gtk::Builder would be worth to look at. Its the
proclaimed successor of libglade and seems to provide a similar
functionality.
And, while looking at the code, why would you derive MainWindowGUI from
sigc::trackable instead of Gtk::Window? While this could be easily
changed in the xsl file to fit everyones personal preference, I was just
wondering whether there is a specific reason.
Would this be feasible? Any xml experts willing to try this?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]