XML
  Home arrow XML arrow Page 4 - Back to XUL: Completing the JavaScript Log...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
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

Back to XUL: Completing the JavaScript Logic
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2006-02-13

    Table of Contents:
  • Back to XUL: Completing the JavaScript Logic
  • Defining a Function
  • The Help Menu
  • The About Window
  • Making the Toolbar Work
  • Finishing up the Functions

  • 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


    Back to XUL: Completing the JavaScript Logic - The About Window


    (Page 4 of 6 )

    The About window is even easier to code then the help system (and that was easy).  All you need to do is create a new XUL file, making use of the <dialog> element to contain the program information, then create a function in the JavaScript file that calls the openDialog() method.  The code for a very basic dialog window can be as follows:

    <?xml version="1.0"?>

    <dialog id="aboutDialog"
            title="About XUL Edit Lite"
            xmlns=http://www.mozilla.org/keymaster/gatekeeper/
    there.is.only.xul
            buttons="accept">

        <description>XUL Edit Lite</description>
        <description>Version: 1.0</description>
        <description>Created by Dan Wellman</description>
        <description>December 2005</description>   

    </dialog>   

        

    This is only very basic information and at this stage, without any CSS. It looks quite bad, but it should give you the general idea.  It can always be tidied up and made to look good when you get around to creating a skin for the application.  The JavaScript function is also very similar and should be added to the bottom of interface.js:

    function lauchAbout() {

      openDialog("about.xul");

    }

    Finally, add the oncommand handler to the relevant menu item:

    <menuitem id="menuAbout" label="&aboutLabel;" accesskey="A"
    key="aboutKey" oncommand="lauchAbout()"/>

    Once you’ve added the calls to these functions in the main XUL file, the menubar is complete; all of the elements should now have been wired up and working.  Before the application is finished however, we still need to add the code that will make the toolbar work.

    More XML Articles
    More By Dan Wellman


       · Hi,This article follows on neatly from the last and shows you the code needed to...
     

    XML ARTICLES

    - Datatypes and More in RELAX NG
    - Providing Options in RELAX NG
    - An Introduction to RELAX NG
    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE
    - UI Design with Java and XML Toolkits
    - Displaying ADO Retrieved Data with XML Islan...
    - Widget Walkthrough
    - Introduction to Widgets
    - The Why and How of XML Data Islands







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