A radio button control groups options in such a way that they are all displayed, but only one may be selected at a time. Place an r inside the braces of the display area to indicate the list of options in the input area of the menu are to be used as a radio button control. For example, the following dialog box displays options in a drop-down list:
// dialog3.pan - drop-down list
@dialog
Generate Noise
Generate Function <w=20>~gfunc = "< >"~<Grandom><Gnormal>
<L>
~menuclear
~setwf(sprintf("%s(100, 1/100)", gfunc))
The list box options are displayed in a standard drop-down list. Placing an r modifier in the display area causes the same options to display as radio buttons.
// dialog4a.pan - radio buttons
@dialog
Generate Noise
Generate Function <r w=20>~gfunc = "< >"~<Grandom><Gnormal>
<L>
~menuclear
~setwf(sprintf("%s(100, 1/100)", gfunc))
Adding the h modifier caused the radio buttons to display horizontally.
// dialog4b.pan - horizontal radio buttons
@dialog
Generate Noise
Generate Function <r h w=20>~gfunc = "< >"~<Grandom><Gnormal>
<L>
~menuclear
~setwf(sprintf("%s(100, 1/100)", gfunc))
Radio buttons have the advantage of displaying all available options at the expense of screen real estate. In general, if the number of options is less than six, radio buttons are preferred over drop-down lists.