MozillaZine

MSDN Magazine Article on XML-Based GUIs

Tuesday October 22nd, 2002

Jacob pointed us towards an interesting Microsoft MSDN Magazine article on using XML to create user interfaces. In the tutorial, Paul DiLascia describes how to "develop an XML-based GUI language parser for .NET that lets you code resources, menus, toolbars, and status bars in XML instead of with procedural code." It introduces new XML elements, including <toolbar>, <button> and <menuitem>. Sound familiar? We thought so.

To be fair, DiLascia, who doesn't work for Microsoft, does acknowledge the influence of XUL, though he states, somewhat bizarrely, that it was developed by the "Java language folks". You can download the MotLib.NET C# class library for use in your own .NET applications but note that Microsoft restrictions prevent you from using it in open-source projects.


#14 More like libglade really

by biswapesh

Wednesday October 23rd, 2002 12:24 AM

You are replying to this message

It's more like a very limited version of Glade + libglade, both of which (at least the former) predate XUL to the best of my knowledge. In libglade, you don't use code generated by glade, you simply load the XML file and Viola ! Your GUI is there. One more function call and all your callbacks are connected as well. As an example, try this: <pre>

int main(int argc, char *argv[]) { GladeXML *xml;

gtk_init(&argc, &argv); glade_init();

/* load the interface */ xml = glade_xml_new("filename-for-interface", NULL); /* connect the signals in the interface */ glade_xml_signal_autoconnect(xml); /* start the event loop */ gtk_main(); return 0; } </pre>