[Glade-devel] REST-Style XML UI Formats and Glade
Gerald Bauer
luxorxul@yahoo.ca
Thu, 8 Apr 2004 11:55:30 -0400 (EDT)
> Well, glade files can be edited directly.
Sure. But the Glade XML UI format is so verbose that
it's not practical to hand-code your UIs. It's only
practical to open existing XML UI files and change a
thing or two.
> Could you try rephrasing this with less buzzwords?
> I'm sure that such a
> generic UI description language might be useful, but
> it doesn't fulfill
> the same role as the glade file format. What would
> you suggest people
> use to describe things that GTK can do that the
> generic UI language
> can't describe?
I don't suggest a generic XML UI language. I suggest
a more compact alternative XML UI format.
For example, let's look a the following Glade XML UI
format snippet:
<widget>
<class>GtkWindow</class>
<name>window1</name>
<title>window1</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GtkVBox</class>
<name>vbox1</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkLabel</class>
<name>label1</name>
<label>Luxor Rocks</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
Now how can you make it more compact and easier to
hand-code? How about the following:
<window
name="window1"
title="window1"
type="TOPLEVEL"
position="NONE"
modal="false"
allow_shrink="false"
allow_grow="true"
auto_shrink="false">
<vbox
name="vbox1"
homogeneous="false"
spacing="0">
<label
name="label1"
label="Luxor Rocks"
justify="CENTER"
wrap="false"
xalign="0.5"
yalign="0.5"
xpad="0"
ypad="0">
Do you see the difference? Do you care? REST-style
means that you care about your XML format. Another
good example of a REST-style XML format besides HTML
is RSS for example.
> Choosing XUL as a
> UI description language is no better, since it means
> you will be using
> the XUL toolkit.
First to clarify by XUL I mean the generic term XML
UI language not for example Mozilla XUL. Anyway, if
you use a compact XML UI format it's much easier to
switch to a different toolkit. The harder the XML UI
format is to read the greater is the lock-in to the UI
toolkit and the UI designer.
>> Well, I guess you somehow missed out on the HTML
>> success story. Why not repeat it?
> I'm not quite sure what you are on about here. What
> does this have to do with glade?
It's simple. If you use a much more compact XML UI
format that you can repeat the HTML success story with
your very own browser using markup for Gtk widgets,
for example.
- Gerald
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca