www.itgalary.com Homepage
Forum Home Forum Home > Web Development > Ajax, XML and XUL
  Active Topics Active Topics
  FAQ FAQ  Forum Search   Register Register  Login Login

Showing menu on button click, menu & menu-button

 Post Reply Post Reply
Author
Message
  Topic Search Topic Search  Topic Options Topic Options
Jijo View Drop Down
Admin Group
Admin Group
Avatar

Joined: 31 Dec 05
Location: United Kingdom
Posts: 495
  Quote Jijo Quote  Post ReplyReply Direct Link To This Post Topic: Showing menu on button click, menu & menu-button
    Posted: 14 May 08 at 4:07pm
Showing menu on button click - use of type menu and menu-button
Any XUL element may be placed inside the button. HTML elements will be ignored, so you need to wrap them inside a description element. If you specify the label attribute on the button, it will override any content placed inside the button.

You can place a menupopup inside the button to cause a menu to drop down when the button is pressed, much like the menulist. However, in this case you must set the type attribute to the value menu.

<button type="menu" label="Device">
  <menupopup>
    <menuitem label="Printer"/>
    <menuitem label="Mouse"/>
    <menuitem label="Keyboard"/>
  </menupopup>
</button>

In this example, the user may click the button to pop up a menu containing three items. Note that selecting one of these menu items doesn't change the label on the button, unlike a menulist. This type of button is intended to be used like a menu, with scripts attached to each item to perform a task.

You can also set the type attribute to the value menu-button. This also creates a button with a menu, but the appearance will be different. Both has an arrow indicating the presence of a menu. For the 'menu', the user may click anywhere on the button to show the menu. For the 'menu-button', the user must click the arrow to show the menu. 

Back to Top
tossy View Drop Down
Bronze Member
Bronze Member
Avatar

Joined: 20 Aug 08
Posts: 64
  Quote tossy Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 10 at 4:15am
Is there any specific steps to replace the menupopup inside the button ?

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

.