XUL
XUL is a cross-platform language that lets you build user interfaces with XML. According to Mozilla‘s website, XUL is:
“XUL (XML User Interface Language) is Mozilla’s XML-based language that lets you build feature-rich cross platform applications that can run connected or disconnected from the Internet. These applications are easily customized with alternative text, graphics and layout so they can be readily branded or localized for various markets. Web developers already familiar with Dynamic HTML (DHTML) will learn XUL quickly and can start building applications right away.”
An example of an user interface for a XUL application is as follows:
<?xml version=”1.0″?>
<?xml-stylesheet href=”chrome://global/skin/” type=”text/css”?>
<window id=”main” title=”My App” width=”300″ height=”300″
xmlns=”http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul”>
<caption label=”Hello World”/>
<toolbox>
<menubar id=”menubar”>
<menu id=”file-menu” label=”file”>
<menupopup id=”file-popup”>
<menuitem label=”new” />
<menuitem label=”open” />
<menuitem label=”save” />
<menuseparator/>
<menuitem label=”exit” />
</menupopup>
</menu>
<menu id=”edit-menu” label=”edit”>
<menupopup id=”edit-popup”>
<menuitem label=”undo” />
<menuitem label=”redo” />
</menupopup>
</menu>
</menubar>
<toolbar id=”main-toolbar”>
<toolbarbutton id=”open” label=”open” />
<toolbarbutton id=”save” label=”save” />
</toolbar>
</toolbox>
</window>
This application (with some configuration) can be run by xulrunner in Linux platforms.
Nice things about XUL are that it is a cross-platform tool. You only develop in XML and then you can deploy it in any platform that supports Firefox (which is developed with XUL). You can leverage your knowledge in XHTML, XML and CSS with it, plus you can take advantage of CSS.
We are not going to get into the details of how to develop applications with XUL, but we will share our experiences with it. So far we are planning to develop an user interface for a project we are working on; which is an stereoscopic player. We are starting the user interface development face of the project and we are looking for cross-platform UI toolkits that will let us develop the UI without a big effort.
One challenge we have to solve the coming days is how to connect it with Python, C++ and C libraries. I will cover more on that in the next post.
Cheers,
Related Articles
- Sunday thought: Please don’t kill XUL (dafizilla.wordpress.com)
- Ubuntu QA blog: Call For Testing: Karmic Firefox Users (or willing to install Karmic in a VM) (qa.ubuntu.com)