Re: [gtk-list] [proposal] GTK Markup Language Specification



>>>>> "Tim" == Timothy M Shead <tshead@sheaddataproc.com> writes:

Tim> As a side note, I recently found out (by accident) that Glade has
Tim> some type of XML output ... unfortunately, I haven't seen it, so
Tim> it's entirely possible I've reinvented the wheel :) On the other
Tim> hand, maybe it's an idea whose time has come ...

Tim> I welcome your feedback,

Your XML is IMO *much* better than the XML generated by Glade.

Take your example:

<gtkml>
  <window type="toplevel" title="Chore-Master 2000">
    <vbox>
      <label>Choose from the following:</label>
      <button>Wash Dishes!</button>
      <button>Take Out Trash!</button>
      <button>Organize Garage!</button>
    </vbox>
  </window>
</gtkml>

The Glade equivalent of that is (slightly edited):

<?xml version="1.0"?>
<GTK-Interface>
<widget>
  <class>GtkWindow</class>
  <name>window1</name>
  <title>Chore-Master 2000</title>
  <type>GTK_WINDOW_TOPLEVEL</type>
  <position>GTK_WIN_POS_NONE</position>
  <allow_shrink>True</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>
      <child>
	<padding>0</padding>
	<expand>True</expand>
	<fill>True</fill>
      </child>
      <label>Choose from the following:</label>
      <justify>GTK_JUSTIFY_CENTER</justify>
      <xalign>0.5</xalign>
      <yalign>0.5</yalign>
      <xpad>0</xpad>
      <ypad>0</ypad>
    </widget>

    <widget>
      <class>GtkButton</class>
      <name>button1</name>
      <child>
	<padding>0</padding>
	<expand>True</expand>
	<fill>True</fill>
      </child>
      <can_focus>True</can_focus>
      <label>Wash Dishes!</label>
    </widget>

    <widget>
      <class>GtkButton</class>
      <name>button2</name>
      <child>
	<padding>0</padding>
	<expand>True</expand>
	<fill>True</fill>
      </child>
      <can_focus>True</can_focus>
      <label>Take Out Trash!</label>
    </widget>

    <widget>
      <class>GtkButton</class>
      <name>button3</name>
      <child>
	<padding>0</padding>
	<expand>True</expand>
	<fill>True</fill>
      </child>
      <can_focus>True</can_focus>
      <label>Organise Garage!</label>
    </widget>
  </widget>
</widget>

</GTK-Interface>

The person who wrote Glade seems to be afraid to use more than the
absolute minimum tag names.  He is even afraid of using attributes.

Your XML is a much more sane (and obvious) application of the XML
technology.

- Dave




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