Creating a XUL application

This tutorial will demonstrate how to use the program interface definition framework to create a XUL application frountend to a command line program.

Prerequisites

We assume you understood the basis of the program interface definition framework and read one of the tutorial to build a command line program.

To run the generated XUL application, the target system needs a XUL interpreter.

For Linux
Firefox (version >= 4) - Recommended or xulrunner standalone binary (version >= 2)

In any case, the binary have to be located in one of the path specified by the PATH environment variable.

For Mac OS X
XUL.framework (version >= 6) - Recommended or Firefox (version >= 4) The XUL.framework have to be installed in a standard location (/Library/Frameworks or ${HOME}/Library/Frameworks) or copied inside the application bundle (not recommended)

Firefox have to be installed in the /Applications folder.

Even if Firefox can be used as a XUL interpreter, the application will not run perfectly well:

Step 1. Defining the command line program

Step 2. Customize the GUI (optional)

The application behavior and the main window UI can be changed at runtime using Javascript.

At start, the application loads a specific Javascript file and look for a onInitialize() function. This entry point can be used to tweak the standard look & feel of the generated frontend by replacing, removing or adding elements.

Step 3. Build the application

For auto-generated shell scripts

																																																																																																																																								 ${NSXML_PATH}/ns/sh/build-xulapp.sh shell -s ${xshFilePath} -o ${outputFolder}
																																																																																																																																							

For auto-generated Python scripts

																																																																																																																																								 ${NSXML_PATH}/ns/sh/build-xulapp.sh python -p ${pythonScriptPath} -x ${xmlOptionDescriptions}
																																																																																																																																							

For existing commands

																																																																																																																																								 ${NSXML_PATH}/ns/sh/build-xulapp.sh cmd -c ${commandName} -x ${xmlOptionDescriptions}
																																																																																																																																							

See also

The build-xulapp documentation for more details and options.

Step 5. Run

Linux

Execute the script file located at the root of the application folder generated in step 3. It's name depends of the <name /> node value in the XML program description file.

Mac OS X

Open the application bundle generated in step 3


The program interface definition framework