XML
  Home arrow XML arrow An Introduction to XUL Part 2
Dev Shed Forums 
Administration  
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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
OLM
 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 2
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 9
    2005-05-30

    Table of Contents:
  • An Introduction to XUL Part 2
  • Organizing Buttons
  • Changing Textbox Attributes
  • Menu Bar and Interface
  • Cleaning Up and Adding a Status Bar
  • Using ToolTips and Progress Bars

  • 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

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    An Introduction to XUL Part 2
    (Page 1 of 6 )

    Learn about XUL, a subset of XML used to describe user interfaces, that helps you to make rich user interfaces with nothing more complicated than a text editor. In the second part of this series, Dan Wellman covers implementing more kinds of buttons. He also begins talking about creating Menu Bars, Tooltips, and Status Bars.

    In addition to standard buttons, you can easily add other types of buttons using the type attribute; you can create buttons that behave as checkboxes so that any number of these types of button can be in a selected/pressed state at any one time, similar to the B, I, and A buttons in a document editing application.  Or you can create buttons that behave as radio buttons, so that only one button within that group can be selected at any one time, much like the justification buttons in a similar application.  Add the following lines of code directly beneath the existing button in your XUL document:

    <button label="I am a Checkbox button!" type="checkbox"/>
    <button label="I am also a Checkbox button!" type="checkbox"/>

    Now save the file and run it again using the DOS command.   Your window will now have three buttons on it, two that can remain in a ‘checked’ state simultaneously.

    Add a group of radio buttons now using the below code, which again should be placed directly beneath the above button code:

    <button label="I am a Radio button!" group="myGroup" type="radio"/>
    <button label="I am also a Radio button!" group="myGroup" type="radio"/>
    <button label="I am another Radio button!" group="myGroup" type="radio"/>

    You use the group attribute to specify that the radio buttons belong in a specific group, which is needed when there are more than one set of buttons in your interface working the way radio buttons do.

    You can even create a menu type button, where the button expands into a set of sub–buttons, grouping related items in a space saving format.  Add the next block of code beneath the existing buttons:

    <button label="I am a menu button!" type="menu">
        <menupopup>
          <menuitem label="I am a menu item!"/>
          <menuitem label="I am also a menu item!"/>
        </menupopup>
    </button>

    This will give you a rather nice little expandable button at the bottom of your window.  It may be useful to know that the submenu that pops up will happily transcend the border of the window itself rather than resize the window to make room for the additional items.  You can alter the appearance of this button slightly by changing the type from menu to menu-button, which puts the little drop-down arrow outside of the button.

    More XML Articles
    More By Dan Wellman


       · I was surprised and begin to work on it. When it came to button part, I have tried...
       · Hi,Sorry to hear you've had problems with this. I know that FireFox is...
       · Worked for me! Here's my code...
     

       

    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