HyperCard -- Popup Buttons and Shared Hilite

Side Navigation Graphic, See Text Links

Find It
Home
Table Of Contents
Support Pages
Feedback & Contact
Apple Computer, Inc.
Mirror Sites
Huh?

ListenUP plug-in URL
By Brian Fant

Shared Hilite Overview

Shared Hilite is primarily intended for use with check boxes and radio buttons. Using Shared Hilite only affects the behavior of the boolean "hilite" property. Popup menus do not use the hilite property for selecting their values, but instead use the selectedLine, selectedLoc, and selectedText properties. Since Shared Hilite only affects the value of the hilite property, you need to write a script to change the selected value of your popup menus from one card to the next.

How It Works

The sharedHilite property controls whether background buttons use a common value for the highlight state on each card of a background (determined by the hilite property), or that value is unique for each card in the background. The key part in this explanation is that sharedHilite only controls the behavior of the hilite property. The hilite property is boolean -- it is either true or false. If a button's hilite property is set to true, then the button appears highlighted (unless it is a popup menu). If a button's hilite property is set to false, then the button appears normally (not highlighted).

Popup buttons do not have a highlighted state, so they look the same, regardless of hilite's value. Although their appearance does not change, HyperCard remembers the settings of the hilite property for popup buttons. (Note that clicking on a popup menu or selecting an item from a popup does not affect the value of the hilite property.)

Every version of HyperCard since version 2.2 can treat buttons as containers, which lets them store values, just like fields. This is the basis for popup buttons. When you click on a popup button, it displays the contents of the button in the popup menu. When you select a value from the popup, it selects that value and records the appropriate information into selectedLine, selectedLoc, and selectedText.

HyperCard does not have the ability to automatically change a popup menuÕs selection as a user switches cards. You need to write your own scripts to change the button's value.

If a stack had a popup menu called "theButton", the user could create a field called buttonValue and use the following background script:


on closeCard
  put the selectedLine of bg btn theButton into fld buttonValue
end closeCard
on openCard
  get word 2 of fld buttonValue
  select line it of bg btn theButton
end openCard
The Famous Apple!

Previous
[Previous] [Top] [Next]

-----------------------------------------------------------

"The Information Alley", in all formats, is copyright Apple Computer, Inc.
All Rights Reserved.