Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

<gadget>

Open abstract class

Summary

The protocol class of all gadgets.

Superclasses

<object> 

Init-keywords

id:
An instance of type false-or(<object>). Default value: #f.

client:
An instance of type false-or(<object>). Default value: #f.

label:
An instance of type type-union(<string>, <image>). Required.

documentation:
An instance of type false-or(<string>). Default value: #f.

enabled?:
An instance of type <boolean>. Default value: #t.

read-only?:
An instance of type <boolean>. Default value: #f.

Library

duim-gadgets

Module

duim-gadgets

Description

The class of all gadgets. You should not create a direct instance of this class.

The id: init-keyword lets you specify a unique identifier for the action gadget. This is a useful way of identifying gadgets, and provides you with an additional way of controlling execution of your code, allowing you to create simple branching statements such as:

select (gadget-id)
    #"ok" => do-okay();
    #"cancel" => do-cancel();
end select;

Note, however, that specifying id: is not generally necessary. The id: init-keyword is useful in the case of tab controls, where it is returned by gadget-value.

Every gadget has a client: that is specified when the gadget is created. Typically, client: is a frame or a composite sheet.

The label: init-keyword lets you assign a label to any gadget. A label may be any string, or an image of an appropriate size (usually a small icon).

The documentation: init-keyword is used to provide a short piece of online help for the gadget. Any documentation supplied for a gadget may be used in a tooltip or a status bar. For example, moving the mouse over a menu command may display the supplied documentation for that command in the status bar of your application, or moving the mouse over any of the buttons in a tool bar may display a tooltip (a piece of pop-up text) that contains the supplied documentation.

If enabled?: is true, then the gadget is enabled; that is, the user can interact with the gadget in an appropriate way. If the gadget is not enabled, then the user cannot interact with it. For example, if a push button is not enabled, it cannot be clicked, or if a check box is not enabled, its setting cannot be switched on or off. Gadgets that are not enabled are generally grayed out on the screen.

If read-only?: is true, then the user cannot alter any of the values displayed in the gadget; this typically applies to text gadgets. Note that this is not the same as disabling the gadget -- if a gadget is set to read-only, it is not grayed out, and the user may still interact with it: only the values cannot be changed.

Operations

activate-gadget choose-from-dialog gadget-accelerator
gadget-accelerator-setter
gadget-client gadget-client-setter gadget-command
gadget-command-setter gadget-default? gadget-default?-setter gadget-documentation
gadget-documentation-setter gadget-value-changing-callback gadget-value-changing-callback-setter
gadget-enabled? gadget-enabled?-setter gadget-id
gadget-id-setter gadget-label gadget-label-setter gadget-mnemonic gadget-mnemonic-setter
gadget-orientation gadget-popup-menu-callback
gadget-popup-menu-callback-setter gadget-read-only? gadget-scrolling-horizontally?
gadget-scrolling-vertically? update-gadget

See also

<action-gadget>, page 526

<border>, page 530

gadget-value, page 585

<group-box>, page 595

<label>, page 597

<menu>, page 612

<page>, page 623

<separator>, page 641

<spacing>, page 647

<tool-bar>, page 678

<value-gadget>, page 691

<viewport>, page 693


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index