[Y-devel] XML Bundle widget

Fred P. fprog26 at hotmail.com
Sun Feb 22 00:41:54 GMT 2004


>Hi folks

>In Mark's thesis he mentions that one way of improving the start-up time 
>would be the possibility of throwing an XML document at the server which 
>then instantiates all the widgets described in the file in a single 
>request. I was thinking that there are more reasons to like the idea of 
>widgets being able to accept and generate XML descriptions. For example it 
>would make it easier to build resource editors. The UI editor could throw 
>some XML at the server which instantiates the user interface, the editor 
>allows the developer to edit the UI and, when done, asks the server to send 
>back the XML for the current state. The XML is then ready to use by the 
>aplication being built.  Another reason is internationalism, you can edit 
>the XML UI description and translate the text without touching the 
>executable.

>I was thinking that the way to go about building this would be to build a 
>widget ("XML Bundle" seems like a good name) which implements a method with 
>a string parameter which is interpreted as XML. The widget parses the XML 
>(using a simple lightweight parser like expat) and instantiates the 
>widgets. The XML file would allow the developer to name widgets - the names 
>would then be associated with the id of the instantiated widget and used as 
>properties on the XML Bundle so that client applications could then look up 
>the identifiers for individual widgets.

That would be cool. In fact, it would be nice to have a XUL interface to Y,
[ XML User Interface Language (XUL) ]
porting application like Mozilla would be easier also.

https://www.mozilla.org/projects/xul/

It would be nice to have a compatible interface, maybe extend it as needed.

XUL support Widget Themes also...

The XML code is quite straight-forward:

<scrollbar
    id="identifier"
    orient="horizontal"/>
    curpos="20"
    maxpos="100"
    increment="1"
    pageincrement="10"/>

<tabbox>
  <tabs>
    <tab label="Mail"/>
    <tab label="News"/>
  </tabs>
  <tabpanels>
    <tabpanel id="mailtab">
      <checkbox label="Automatically check for mail"/>
    </tabpanel>
    <tabpanel id="newstab">
      <button label="Clear News Buffer"/>
    </tabpanel>
  </tabpanels>
</tabbox>

<button
    id="identifier"
    class="dialog"
    label="OK"
    image="images/image.jpg"
    default="true"
    disabled="true"
    accesskey="t"/>

For instance you may want to add "x,y,width,height" properties...


>To do this in a clean way would require each widget class to have methods 
>supporting the parsing and generation of the XML that represents it. This 
>way the XML Bundle widget doesn't need to know anything about the widgets 
>it's buildng except how to find the correct widget class to hand a piece of 
>XML to (actually I would probably not pass the XML itself but instead route 
>the callbacks from the XML parser to the widget class concerned).

>So, before I start coding, does anyone have any comments on the above? 
>Anyone already started doing something similar?

For widget, XUL is about it.

Another technology you may look at is SVG for form rendering and projects 
like KSVG.

Have fun,
Fred.

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.  
https://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved