More Running anyone?

In my last post, I talked about working with XULRunner, and just a few of the things you can do with it. I thought now would probably be a good time to write up a small tutorial, based on my own knowledge and that gathered from various sources.

Setting Up the Workspace

You can download the XULRunner packages from the ftp index of mozilla.org. Now that you have the zip archive of XULRunner, you’ll need to setup your file directories. I’d recommend setting them up some what like this:

  • /myapp
    • /xulrunner
      • contents of xulrunner download.
    • /chrome
      • /content
        • main.xul
      • /skin
      • /locale
      • chrome.manifest
    • /defaults
    • /preferences
      • pref.js
    • application.ini

Take note of the files “chrome.manifest”, “prefs.js” and “application.ini”, these will be explained in more detail later.

Writing your application.ini file…

This is a small file that tells XULRunner various information about your application, how your application intends to use the XULRunner platform as well as configure some information that XULRunner uses to run your application. An example of one:

[App]
Vendor=Finkle
Name=Test App
Version=1.0
BuildID=20060101
Copyright=Copyright (c) 2006 Mark Finkle
ID=xulapp@starkravingfinkle.org
[Gecko]
MinVersion=1.8
MaxVersion=1.8

Addings prefs and the chrome Manifests.

The chrome Manifest is used to tell xulrunner which directories to looks in for specifc files, and sets up chrome registration. Application chrome can be in a single or a few JAR files or uncompressed as folders and files. Example:

content myapp file:content/

The prefs.js file tells XULRunner the name of the XUL file to use as the main window. Here is an example:

pref("toolkit.defaultChromeURI", "chrome://myapp/content/main.xul");

Next Time…

Next time i bring you a tutorial, it’ll probably be a little more on the javascript functions of jslib or something of the sorts, but right now, your at the stage where you get to build your XUL. Read more at Mozilla Developer Center

Advertisements



    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s



%d bloggers like this: