Open abstract instantiable class
A class that groups buttons.
rows:false-or(<integer>).
columns:false-or(<integer>).
orientation:one-of(#"horizontal", #"vertical"). Default value: #"horizontal".
layout-class:subclass(<layout>). Default value: <column-layout> or <row-layout>, depending on orientation.
child:false-or(<sheet>). Default value: #f.
duim-gadgets
duim-gadgets
The class of grouped buttons; the superclass of <check-box> and <radio-box>.
The rows: and columns: init-keywords allow you to specify how many rows or columns should be used to lay out the buttons. In addition, you can set the orientation of the button box by specifying the orientation: init-keyword.
An instance of the class that is specified by layout-class: is used to parent the buttons that are created, and any extra arguments that are specified, such as x-alignment: and x-spacing:, are passed along to this layout.
You can use the child: init-keyword to specify a sheet hierarchy to be used in place of a list of items. Under normal circumstances, the items defined for any button box are realized in terms of their "natural" gadget class. For example, if you create a radio button box, DUIM creates a radio button for each item that you specify. By using the child: init-keyword, you can define sheet hierarchies that override these "natural" gadget classes, letting you specify more complex arrangements of gadgets: in this way, you could create a check button box where each check button is itself surrounded by a group box. For an example of the use of the child: init-keyword, look at the initial dialog box that is displayed when you first start the Dylan environment. In this dialog, a number of radio buttons are presented, each delineated by its own group box. In fact, this dialog is implemented s a radio button box in which the child: init-keyword has been used rather than the items: init-keyword.
If you use child:, then the gadget-value returned by the gadget is the gadget-id of the selected button. Contrast this with items:, where the selected item is returned as the gadget-value.
contain(make(<button-box>,
selection-mode: #"multiple",
items: range(from: 0, to: 20))); The following examples illustrate the use of some of the init-keywords described. They each create an instance of a subclass of <button-box>. Note that the selection-mode: init-keyword may be used instead, rather than creating a direct instance of one of the subclasses.
contain(make(<check-box>, items: range(from: 1, to: 9),
columns: 3));contain(make(<radio-box>, items: #("Yes", "No"),
orientation: #"vertical");contain(make(<check-box>, items: #(1, 2, 3. 4),
layout-class: <table-layout>
rows: 2)); <check-box>, page 537
<push-box>, page 626
<radio-box>, page 630