[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 User's Guide



Using Buttons

Buttons are basic components that activate functionality in Motif applications. Buttons operate as standalone interface components and are also used in building Menus and DialogBoxes.

Using PushButtons

A PushButton contains a label that indicates the function of the button. The label can be either text or an image. The Motif PushButton has a 3-dimensional appearance. A PushButton appears raised out of the screen. When the button is pushed, it appears recessed into the screen. Figure 3-2 shows a typical PushButton.

Figure 10. A PushButton.




View figure.

To activate the functionality of a PushButton with the mouse:

  1. Move the pointer to the PushButton.

  2. Click Button 1.

    If the PushButton has the input focus, you can activate it from the keyboard by pressing Selector Space.

  3. Using ToggleButtons

    A ToggleButton is a button that has three states: on, off, and indeterminate. ToggleButtons typically allow you to select one or more options from a list of choices. Every ToggleButton has a label and a graphic that indicates its current state. Some of the possible indicators are checkboxes, crossboxes, plain boxes, diamonds, and circles.

    RadioButtons are a group of ToggleButtons where only one of the ToggleButtons can be on at any one time, like an old-style car radio. RadioButtons do not have indeterminate states. The associated graphic indicator for the state of RadioButtons can be either a diamond or a circle. When the diamond or circle is filled in, it indicates that the button is on; when the diamond or circle is empty, it indicates that the button is off. Figure 3-3 illustrates a RadioBox with diamond graphic indicators.

    Figure 11. RadioButtons.




    View figure.

    To select a RadioButton with the mouse:

    1. Move the pointer to the RadioButton's label.

    2. Click Button 1.

      Clicking on a RadioButton that is in the off state changes its state to on. Any other RadioButton in the group that is in the on state is set to the off state. Clicking on a RadioButton that is currently on causes the button to go on and off again quickly.

      If a RadioButton has the input focus, you can turn it on by pressing Select or Space. Any RadioButton in the group that currently is set is turned off. You can navigate through a group of RadioButtons with the arrow keys.

      CheckButtons are a group of ToggleButtons where any number of the ToggleButtons can be on at the same time. The CheckButton's associated graphic indicator is usually a square, which is filled in or differently colored when the button is on (see Figure 3-4).

      Figure 12. CheckButtons.




      View figure.

      To select a CheckButton with the mouse:

      1. Move the pointer to the CheckButton's label.

      2. Click Button 1.

        Clicking on a CheckButton in the off state changes its state to on. The button retains this setting as you select other CheckButtons. Clicking on a CheckButton in the on state changes its state to off or indeterminate, depending on how the CheckButton is set up. If the CheckButton is set up to be able to have an indeterminate state, then clicking on a CheckButton in the on state changes its state to indeterminate. Otherwise, clicking on a CheckButton in the on state changes its state to off.

        If a CheckButton has the input focus, you can toggle between the on and off states by pressing Select or Space. You can navigate through a group of CheckButtons with the arrow keys.


      3. [ Previous | Next | Contents | Glossary | Home | Search ]