This article, the second in a series about the XML variant called XUL, gets you started on creating the main interface for an application. Among other things, it covers sub-menus, toolbars, and the main content window.
As a point of interest, the keymaster and gatekeeper used in the namespace are references to the classic movie "Ghostbusters." Anyway, the id attribute is optional; it is used for referencing and scripting. Other attributes include the title attribute, the value of which is displayed in the title bar at the top of the window, and the width and height attributes. The most common screen resolution in use today is 800 x 600, so I've set the height and width attributes to these numbers. When running XUL applications within Mozilla, they won’t have a title bar of their own.
In most Windows applications, the menu bar is right at the top of whichever application you are using. We will follow this tradition, so your next element (or group of elements) will be a menu bar:
The menu is encapsulated within a toolbox element so that it can be expanded or collapsed using a grippy. This is not strictly necessary but I like it, and we want our application to integrate smoothly with Mozilla, so using standard features like this helps retain consistency.
As you can see, the label is an entity reference rather than the actual text that is being displayed. This is partly because XUL experts insist that this is the proper way to do things and partly because it’s a good way of demonstrating how easy it is to provide alternative locale features, like supporting other languages.
The accesskey attribute specifies the keyboard key that can be used as a shortcut in combination with the ALT key. Again, this is universal in Windows applications.