5.13 Menubutton widget

5.13.1 Description

A menubutton is a widget that displays a textual string, bitmap, or image and is associated with a menu. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines or if wrapping occurs because of the wraplength option) and one of the characters may optionally be underlined using the underline option. In normal usage, pressing mouse button 1 over the menubutton causes the associated menu to be posted just underneath the menubutton. If the mouse is moved over the menu before releasing the mouse button, the button release causes the underlying menu entry to be invoked. When the button is released, the menu is unposted.

Menubuttons are typically organized into groups called menu bars that allow scanning: if the mouse button is pressed over one menubutton (causing it to post its menu) and the mouse is moved over another menubutton in the same menu bar without releasing the mouse button, then the menu of the first menubutton is unposted and the menu of the new menubutton is posted instead.

The menu that drops down when the menubutton is activated is defined either by a record describing a menu, or by a previously built menu with the Qtk.buildmenu command. See Section 6.10 for details about menus.

5.13.2 Parameters

5.13.3 Interface

The object you get by an handle on the widget implements the following methods :


Donatien Grolaux
Version 1.2.3 (20011129)