Removing and Disabling Buttons

You can also remove or disable buttons when the user enters a topic (by jumping to the topic, selecting it from a search or history list, or choosing a browse button or the Back button to display it). If you remove a button from a topic, the button doesn't appear on the button bar. If you disable a button, the button appears dimmed on the bar. The button remains disabled or removed until the user quits Viewer or opens a new title. The procedure for removing and disabling buttons in individual topics is much the same as the procedure for adding buttons.

To remove an authored button when the user displays a topic, enter the DestroyButton command as an exclamation-point footnote. To disable the button, type the DisableButton command. These commands have the following form:

DestroyButton("button-id")
DisableButton("button-id")

In either command, button-ID is the ID, enclosed in quotes, you assigned in the CreateButton command.

For example, you might enter the following footnote to remove the Time button:

!DestroyButton("time_btn")

Enter the following footnote to disable the Time button:

!DisableButton("time_btn")

The button bar with the disabled Time button appears as follows:

Note:

button from button bar>

You cannot delete or disable any of the standard Viewer buttons (Contents, Index, Back, History, Search, <<, or >>).