XML
  Home arrow XML arrow Page 4 - An Introduction to XUL Part 4
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
XML

An Introduction to XUL Part 4
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 7
    2005-06-13


    Table of Contents:
  • An Introduction to XUL Part 4
  • Using the RDF/XML Syntax
  • Creating the Wizard
  • Adding to the installed-chrome.txt file

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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 4 - Adding to the installed-chrome.txt file
    ( Page 4 of 4 )

    So that’s the RDF file, and the wizard file is in place, but before the wizard can be accessed via chrome, you still need to add some code to another file -- the installed-chrome.txt file. This file lives in the default install directory of Mozilla. Open it up and add the location of your XUL file to the bottom (for clarity, the path to mine is C:/XUL/Chrome/mywizard.xul)

    content,install,url,file:///C|/XUL/chrome/

    You must add a hard return after this.  Now save the installed-chrome file, and from the same folder (the Mozilla chrome folder), delete the file called contents.rdf. Open Mozilla, and this file will be regenerated.  Open this file in a text editor, and you should be able to find the name of XUL wizard you have just created in there. To access your wizard, in the Mozilla address bar, type the following URL:

    chrome://yourfilenamehere/content/

    When the cancel or finish buttons are clicked Mozilla will close; this isn’t because you’re doing something wrong, but because the wizard is not being opened from another XUL window. Also, there is no functionality behind this example wizard that would pass any values back to a calling window. 

    Looking at the wizard through Mozilla, you might also agree that the example code in the wizard is a little difficult to distinguish from the narrative text of the wizard.  I mentioned in the first article that XUL is compatible with CSS, so what you might want to do is create the following CSS file:

    .codetext {

      font-weight:bold;
      font-size:12pt;
      text-indent:20pt;
      background-color:#5B7693;
      padding:10pt;

    }

    I have called mine dansStyle.css but feel free to call it whatever you like. Save it in the same directory as your XUL and RDF files and add a stylesheet reference to the top of the wizard file:

    <?xml-stylesheet href="dansStyle.css" type="text/css"?>

    This needs to appear directly after the XML declaration.  Once that is in place, simply add a class="codetext" attribute to each of the opening description tags that enclose a CDATA element. Run the wizard once more and see your code highlighted, emboldened and indented to facilitate easy distinguishing of the example code.  

    Wizards are often used to capture more complex input from a user than a simple yes or no (when a dialog window would be more appropriate).  Form controls can be placed inside wizards so that if, for example, a menu item was selected, the user could be guided through a series of questions or options. Once these questions had been answered, or the options selected, the results would be passed back to the window that the menu item that originally prompted the wizard resides in. In these cases, Mozilla would remain open. 

    The next article will look at the creation of dialog boxes and discuss some of the more complex issues of these types of windows, such as opening or saving dialog boxes.



     
     
    >>> More XML Articles          >>> More By Dan Wellman
     

       

    XML ARTICLES

    - Flex Array Collection Sort and Filtering
    - The Flex Tree Control
    - Flex List Controls
    - Working with Flex and Datagrids
    - 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...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek