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.


#1 I found the reference to XUL in that article

by Luke_Morey

Tuesday October 22nd, 2002 10:58 AM

Reply to this message

"XUL—or something like it—is just the ticket to GUI greatness!"

XUL is just the ticket to GUI greatness! -or something like it-

... warning, warning.

#2 Not licensed to open source?

by turi

Tuesday October 22nd, 2002 11:02 AM

Reply to this message

That's a funny license, that is....

The license states:

"You may not include MotLib.NET as part of an open-source project."

And in the FAQ:

"Do I get source code?

Yes."

So it's in fact an open source programm itself (not an entirely free programm, but open source none the less). If the restriction actually is inherited from Microsoft's license, it means, that you can't use MotLib.NET with the .NET-framework. Well, that's funny: Software noone can use at all..... How useful.

#12 Re: Not licensed to open source?

by emlyn

Tuesday October 22nd, 2002 8:05 PM

Reply to this message

It's not open source. It's got a bunch of restrictions on its use which the OSI forbids in open-source-certified licences - not the least of which is the bit saying "You may not include MotLib.NET as part of an open-source project".

Some people choose to refer to free software by the name "Free Software" rather than "Open Source" to cut down on this kind of confusion (and because "Free Software" was the original name). Unfortunatly, what tends to happen is a different type of confusion, over the meaning of the word "free".

What we need is a truely unambiguous name. But it's not going to happen.

#15 Re: Re: Not licensed to open source?

by turi

Wednesday October 23rd, 2002 1:02 AM

Reply to this message

Yes, it's neither an OSI nor an FSF compliant license. But the term "open source" itself isn't defined solely by the OSI. In a legal text like a license you'd have to be very clear about what you mean. The license here is extremely unclear and just says "open source". It's source is partly open which opens the door to a lot of legalistic possibilities.

But it's nonetheless noteworthy that a company like Microsoft tries ot build a community like the free software community without giving it the necessary freedoms.

#32 The "source"?

by IriseLenoir

Saturday October 26th, 2002 12:15 AM

Reply to this message

What's more, if it's an XML GUI, the "source" and the distributed GUI is the same... it might be compressed, but there's no way to really hide the source? Does that make it API that is illegal to use under all circumstances? Very useful...

#3 Mot

by eiseli

Tuesday October 22nd, 2002 11:24 AM

Reply to this message

Quote from the article: «and mot is a French word that means "a witty or incisive remark; an epigram."»

I don't know where on earth he found this, in French Romantic Verses or what? Much less poetically, "mot" just means "word". Welcome back on earth :)

#4 Bon Mot

by mbrubeck

Tuesday October 22nd, 2002 11:38 AM

Reply to this message

He was probably thinking of <a href="<http://labs.google.com/glossary?q=bon+mot>">bon mot</a>.

#5 Bon Mot (fixed link)

by mbrubeck

Tuesday October 22nd, 2002 11:39 AM

Reply to this message

He was probably thinking of "bon mot": <http://labs.google.com/glossary?q=bon+mot>

#6 Re: Mot

by stevengj

Tuesday October 22nd, 2002 11:42 AM

Reply to this message

The actual French term is "bon mot" ("good word"), but it is sometimes abbreviated in English usage to simply "mot" ("mot juste" is another commonly borrowed phrase from French).

#11 Thanks for the English class :)

by eiseli

Tuesday October 22nd, 2002 6:10 PM

Reply to this message

Yep. Subject says it all. However I still can add that the meaning of "bon mot" in french just means "correct word". You'll find tons of french pages using "bon mot", but in the following contexts: "how to choose a good password" (bon mot de passe) or "fill in the blank with the correct (matching) word". So the _english_ expression means "witty comment", and has its origin in French. But it _definitely_ is not french.

#13 Found the French origin !

by IriseLenoir

Tuesday October 22nd, 2002 8:49 PM

Reply to this message

Never heard "bon mot" in that meaning either... Englishmen do have a tendency to use french words with a different meaning so it wouldn't surprise me that it has nothing to do with french.

Ah! Found it: it comes from a XIIIth century french expression, meaning "parole piquante". It makes sence, since most of the French words in the english language have been introduced in the XIVth century.

Mystère résolu ;-)

Source: Dictionnaire étymologique et historique de la langue française, éditions Livre de Poche

#16 merci !

by eiseli

Wednesday October 23rd, 2002 1:30 AM

Reply to this message

De nouveau qqch d'appris :)

Let's all learn medieval French so we can understand English and American people when they try to speak French ;-)

#7 Was XUL the first to use XML for GUIs?

by t_evans <t.evans-mz@aranz.com>

Tuesday October 22nd, 2002 4:12 PM

Reply to this message

I would have thought that the GTK GUI editor 'Glade' was the first to build GUIs from XML. Although glade is really just using XML as just a save format, you don't normally edit it by hand.

#8 Re: Was XUL the first to use XML for GUIs?

by erik <erik@eae.net>

Tuesday October 22nd, 2002 4:54 PM

Reply to this message

Netscape Navigator 2 was definately before Glade :-)

The first markup used for a visual presentation is also the first markup for a GUI.

Is Glade really that old? I thought XUL was older than Glade.

I don't know which came first: XUL, UIML or NetDocs (or whatever MSFT called their internal XML UI language)?

#9 Re: Was XUL the first to use XML for GUIs?

by t_evans <t.evans-mz@aranz.com>

Tuesday October 22nd, 2002 5:27 PM

Reply to this message

According to <http://glade.gnome.org/history.html>, version 0.1 of glade was released on 18 Apr 1998. The earliest mention of XUL that google can find in netscape.* is 4 Dec 1998, but this is only mentioning XUL is passing as something that either already exists or is already planned. Anybody know when XUL was first proposed and/or implemented?

#29 Glade: Apr 1998; XUL: Feb 1999

by tepples <tepples@spamcop.net>

Thursday October 24th, 2002 9:46 AM

Reply to this message

> Netscape Navigator 2 was [a] markup for a GUI.

I don't think Netscape 2's limited support for HTML forms and ECMAScript qualifies as a way to define a complete GUI within a web page.

> I thought XUL was older than Glade.

<http://www.mozilla.org/xpfe/> says XUL has been around since about February 1999. <http://glade.gnome.org/history.html> says Glade has been around since mid-1998.

#17 Re: Was XUL the first to use XML for GUIs?

by mmarquee

Wednesday October 23rd, 2002 6:50 AM

Reply to this message

Glade can also be used to create dialogs, etc straight from the xml source. So you can change the user interface without actually recompiling the application. Its great!

#18 Re: Re: Was XUL the first to use XML for GUIs?

by AlexBishop <alex@mozillazine.org>

Wednesday October 23rd, 2002 7:31 AM

Reply to this message

"Glade can also be used to create dialogs, etc straight from the xml source. So you can change the user interface without actually recompiling the application. Its great!"

But can you change the UI without even closing the application, like you can with Mozilla? :-)

Alex

#25 Re: Re: Re: Was XUL the first to use XML for GUIs?

by bamm <bamm@gabriana.com>

Thursday October 24th, 2002 3:34 AM

Reply to this message

"But can you change the UI without even closing the application, like you can with Mozilla? :-)"

I don't think you can do this in Mozilla. As a skin developer one of my complaints is that I have to quit Mozilla everytime I check a small update to the skin.

#27 Re: Re: Re: Re: Was XUL the first to use XML for G

by Hendikins

Thursday October 24th, 2002 7:45 AM

Reply to this message

I thought if you were using an unjarred skin with XUL cache off, you *could* change the UI whilst Moz was running

#28 Re: Re: Re: Re: Re: Was XUL the first to use XML f

by AlexBishop <alex@mozillazine.org>

Thursday October 24th, 2002 9:11 AM

Reply to this message

"I thought if you were using an unjarred skin with XUL cache off, you *could* change the UI whilst Moz was running"

You can. I've done it.

Alex

#31 Don't forget the DOM inspector...

by michaelg <mike@vee.net>

Friday October 25th, 2002 7:26 AM

Reply to this message

The DOM inspector is pretty useful for experimenting, tweaking and debugging as well.

Gee, I really love that tool..

/mike.

#30 Re: Re: Re: Was XUL the first to use XML for GUIs?

by james

Friday October 25th, 2002 1:04 AM

Reply to this message

> But can you change the UI without even closing the application, like you can with Mozilla? :-)

Depends on the application. Libglade (the library used to read Glade's XML files at runtime) will read the XML file when the application asks it to. If the application creates the dialog once, then just hides/shows it when needed, the answer is no. If it destroys the dialog each time it is closed and then recreates it when needed later, the answer is yes.

I guess the same goes for mozilla.

James (the guy who wrote libglade).

#19 Re: Was XUL the first to use XML for GUIs?

by rphilips <richard.philips@ua.ac.be>

Wednesday October 23rd, 2002 10:18 AM

Reply to this message

I think using SGML in building GUIs was first used in OS/2

When Microsoft left OS/2, IBM did not use SGML anymore.

#23 Re: Re: Was XUL the first to use XML for GUIs?

by choess <choess@stwing.upenn.edu>

Wednesday October 23rd, 2002 5:44 PM

Reply to this message

I know I've seen a paper in Citeseer about building GUIs with SGML and some Smalltalk dialect.

#10 Heh Heh dose MSDN guys

by taxexile

Tuesday October 22nd, 2002 5:47 PM

Reply to this message

I reckon they'll always consider Netscape/Mozilla as the Java guys... what with the Sun legacy.

#20 Maybe they were thinking of javascript

by Salsaman

Wednesday October 23rd, 2002 1:17 PM

Reply to this message

n/t

#14 More like libglade really

by biswapesh

Wednesday October 23rd, 2002 12:24 AM

Reply 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>

#21 Re: More like libglade really

by spage

Wednesday October 23rd, 2002 1:54 PM

Reply to this message

> you simply load the XML file and Viola ! Your GUI is there

That would give you a string instrument similar to a violin.

I think le bon mot juste that you're looking for is "Voilà", as in "Lo, there it is"

#22 That's what one calls to stay on topic ;-) (n/t)

by eiseli

Wednesday October 23rd, 2002 2:48 PM

Reply to this message

.

#24 Re: Re: More like libglade really

by choess <choess@stwing.upenn.edu>

Wednesday October 23rd, 2002 5:55 PM

Reply to this message

What!? This is a Mozillazine forum! Obviously, he's referring to the *browser* Viola. ;-)

#26 Re: Re: More like libglade really

by dantealiegri

Thursday October 24th, 2002 6:21 AM

Reply to this message

Gasp.. calling the viola "similar" to the violin.

Hope you get mobbed by a pack of rabid violists ;)

#33 search for "xul" on msdn returns 0 results

by tomtul2

Tuesday October 29th, 2002 7:28 PM

Reply to this message

was wondering what else MS says about XUL, if they have any plans to support it, but found NO REFERENCES to it searching. despite the fact that this article mentions XUL:

Your search using "All words" for ""xul"" returned 0 results. <http://search.microsoft.c…mp;i=41&siteid=us/dev>