Radio buttons

Radio buttons are implemented using a generalization of the BooleanVBT called a ChoiceVBT. The main steps of a typical application are:
  1. Create a collections of switches. The program RadioButtons uses margin feedback with bullets in the margin.
  2. Create a new Radio group using NEW(ChoiceVBT.Group).
  3. Create a ChoiceVBT for each switch and override its callback method with the action appropriate for the switch. Initialize its radio group to be the group created in step 2.

The ChoiceVBT interface provides routines that get and set the current selection of the group of radio buttons.

The program RadioButtons.m3 illustrates the use of radio buttons. And the following images:

provide three views of the application.