🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #20287

Re: Hypercard again (radio button)

#20287
From: Bill Faulkner
Date: Mon, 12 Oct 1987 16:54
75 lines
3694 bytes
In article <166@stech.UUCP>, sysop@stech.UUCP (Jan Harrington) writes:

> How you handle the highlighting depends on whether you've checked Auto hilight
> when you defined the button.  If Auto hilight is checked (in that dialog box
> you get for buttons), then Hypercard will take care of turning the button on
> and off.  You can check the button's state with something like:
> 
> 	if autoHilite of button ID XX is true then
> 		.....
> 
> Replace the XX, of course, with the right button ID or ID XX with the button's
> name if the script is attached to something other than the button itself.  If
> the script is attached to the button itself, then you don't need the button
> identifier.	

What you said is true, however, you are misleading people.  Both hilite and
autoHilite are properties of a button, but they are vastly different.
Checking the state of autoHilite, tells you nothing about the button being
"on"


> If Auto hilight isn't selected, then you must attach a script to each button
> which detects mouseup events, checks the current hilite state, and then sets
> the button accordingly:
> 
> 	if hilite is true then
> 		set hilite false
> 	else
> 		set hilite true
> 	.....
> 
> In most cases, using Auto hilite is certainly easier!

NO NO NO NO!  You don't understand radio buttons at all! If you click on
a hilited radio button it should remain on.  And for radio buttons,
Autohilite is NOT the way to proceede.  I know, because I have developed
a stack that uses radio buttons.

Now to answer Chuq's question about how to develop radio buttons.

First, create the set of buttons that you want to use as a set of radio
buttons and organize them in a logical manner.  Set the Autohilite to off
and show name to on.  Say you have five buttons numbered 1-5.  The script
for button number 1 would be like this:

on mouseUp
  set hilite of button 2 to false
  set hilite of button 3 to false
  set hilite of button 4 to false
  set hilite of button 5 to false
  set hilite of button 1 to true
  --
  --  do what ever this button is supposed to do
  --
end mouseUp

The other 4 buttons would proceed in a similar fashion, with the script of
button n that turns the hilite of button n to true and all the others
to false.  This will give you the action of standard "radio buttons".
Also note, that due to personal prefence, I will set the hilite of button
n to true after all the other button hilites are set to false.  This is
to prevent seeing 2 radio buttons checked at the same time, although
this time is rather small.  I would rather buttons hilited for the split
second it takes to change all the button's states.

True, it is not the most elegant solution to the problem, but it is
what you are stuck with, since hypercard doesn't know about radio buttons
other than they are just another button style.

		Bill
-- 
Bill Faulkner * NCAR (Nat'l Center for Atmospheric Research)
PO Box 3000 * Boulder, CO  80307-3000 * 303-497-1259
UUCP:  faulkner@scdpyr.UUCP or  ..!hao!scdpyr!faulkner
INTERNET: faulkner@scdpyr.ucar.edu  ARPA: faulkner%ncar@csnet-relay.arpa
Technical Details
Message-ID: <179@scdpyr.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!cmcl2!rutgers!sunybcs!boulder!hao!scdpyr!faulkner
References: <30200@sun.uucp> <166@stech.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!cmcl2!rutgers!sunybcs!boulder!hao!scdpyr!faulkner
From: faulkner@scdpyr.UUCP (Bill Faulkner)
Newsgroups: comp.sys.mac
Subject: Re: Hypercard again (radio button)
Message-ID: <179@scdpyr.UUCP>
Date: Mon, 12-Oct-87 12:54:15 EDT
Article-I.D.: scdpyr.179
Posted: Mon Oct 12 12:54:15 1987
Date-Received: Thu, 15-Oct-87 23:44:38 EDT
References: <30200@sun.uucp> <166@stech.UUCP>
Organization: Natl Ctr Atmospheric Research, Boulder, CO
Lines: 75