[comp.sys.mac.hypercard] Create buttons with YOUR defaults

blob@apple.com (Brian Bechtel) (03/10/89)

I'm probably not the only person to ever come upon this, but for you 
novice Hypertalkers out there:

In general, I like my buttons to conform to the user interface guidelines.  
This means  highlight when selected; the autohilite property should always be 
turned  on.  What a royal pain, changing this property every time I create a 
new button.

A few seconds with the "HyperCard Scripting Language Guide" by Addison 
Wesley reveals that you can put a handler in your stack (or card) that 
says:

on newButton
  set the autohilite of the target to true
end newButton

This can actually get really complicated, such as

  on newButton
    global newButtonName  -- set somewhere else
    if word 1 of the name of the target is "bkgnd" then exit newButton
    set the name of the target to newButtonName
    set autohilite of the target to true
    set style of the target to transparent
    set textfont of the target to "New York"
    set textsize of the target to 10
  end newButton

to get transparent buttons with autohilite and their name displayed in 10
point New York.

Was I the only person who didn't realize this stuff?

--Brian Bechtel     blob@apple.com     "My opinion, not Apple's"

c60c-3dr@web-2h.berkeley.edu (Rob Menke) (03/11/89)

> A few seconds with the "HyperCard Scripting Language Guide" by Addison 
> Wesley reveals that you can put a handler in your stack (or card) that 
> says:

Better yet, you could slap it into your Home stack. Then ALL stacks would
follow your defaults, except, of course, if you override it by placing an
intercepting handler earlier in the hierarchy.

> --Brian Bechtel     blob@apple.com     "My opinion, not Apple's"

Milk and honey, milk and honey.		|
Fresh whole lizard, fresh whole lizard.	|  Robert Menke
Killed in the light of a crescent moon.	|    WEB.berkeley.edu!c60c-3dr
Mix 'em with a pinch o' garlic.		|    Apple!bmug!Robert.Menke
Then stand back! Cause it go BOOM!	|