XML
  Home arrow XML arrow An Introduction to XUL Part 2
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 2
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 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:
      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 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
     

       

    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