XML
  Home arrow XML arrow Page 2 - An Introduction to XUL Part 1
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

An Introduction to XUL Part 1
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 21
    2005-05-23

    Table of Contents:
  • An Introduction to XUL Part 1
  • Getting started
  • Follow the rules
  • Adding buttons

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    An Introduction to XUL Part 1 - Getting started


    (Page 2 of 4 )

     

    Before you start making XUL interface objects, such as windows with menus, toolbars, and so forth, you need to make a modification to your system environment variables (after Mozilla has been installed to the default location, of course). You can do this by using the DOS command line, or you can do it easily with the System applet on your Windows Control Panel. I’m assuming that you have Windows XP installed as your operating system here; if not, this section probably wont help you. XUL itself should still work, though, because this is a cross-platform technology. 

    I initially tried to do it using the command line method, which failed repeatedly (although I have no idea why), so I reverted to using the System applet method instead, and it worked the first time. To add the path variable to your system environment using the System method, just go to the System icon in the control panel, select the Advanced tab, and click on Environment Variables. Now click on the bottom New button; in the Variable Name field type "path" (without the quotation marks) and in the Variable Value field type "C:\Program Files\mozilla.org\Mozilla" (again, without the quotation marks). Make sure that this is typed as it appears here -- don’t set the Name field to Path instead of path, for example, because there is already a Path variable present. Now click OK until the System box disappears and you’ll be ready to go.

    When producing XUL test files, in order to follow this article and in general, it is a good idea to use the DOS command line to execute the files. You can open the files from within Mozilla once the environment variable has been added correctly, but this will cram your window among the elements of Mozilla’s interface, and will detract from your learning experience. Opening basic files via the Mozilla interface does not appear to give you any extra functionality, although some of the more advanced elements must be opened through Mozilla using a chrome URL. This will be discussed later on. 

    You can also create plugins and even entire applications using XUL, but there is far more work that needs to be done, including modifying Mozilla to get it to include your plugin when it launches. In those cases, you wouldn’t need to use the command line. In development however, to execute a file, for example, called myFirstWindow.xul that was stored in a directory called XUL within the root directory, you would need to open a command line instance (by typing cmd in the run bar for those of you that don’t already know) and type: "Mozilla –chrome file://C:/XUL/myFirstWindow.xul" without the quotation marks.  You would get the Mozilla splash screen, and then a window would appear. As you’ll need a directory to store your test XUL files in, you might as well make a XUL folder on the C: drive now.

    More XML Articles
    More By Dan Wellman


       · """I initially tried to do it using the command line method, which failed repeatedly...
       · Thanks for clearing that up for me, I was curious as to why the command line method...
       · Unfortunately, it would seem your advice is flawed. Windows is case-insensitive, so...
       · Hi,I use winxp pro, which does not appear to be case sensitive when adding the...
       · To set the path variable in the autoexec.bat file AND keep previous paths,...
     

       

    XML ARTICLES

    - How to Set Up Podcasting and Vodcasting
    - Creating an RSS Reader Application
    - Building an RSS File
    - An Introduction to XUL Part 6
    - An Introduction to XUL Part 5
    - An Introduction to XUL Part 4
    - An Introduction to XUL Part 3
    - An Introduction to XUL Part 2
    - An Introduction to XUL Part 1
    - XML Matters: Practical XML Data Design and M...
    - Practical XML Data Design and Manipulation f...
    - SimpleXML
    - XForms Basics, Part 3
    - XForms Basics, Part 2
    - XForms Basics





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway