Default buttons OS X

J. Landman Gay jacque at hyperactivesw.com
Sun Apr 23 20:00:21 EDT 2006


Bill wrote:
> I thought this might be what I would have to do. Thanks. And thanks for the
> explanation as to why changing the button to "default" is really just for
> the style.

It's customary to trap the Return key and the Enter key to handle 
default buttons:

on returnKey
  -- myStuff
end returnKey

on enterKey
  -- myStuff
end enterKey

on myStuff
  -- do default button behavior
end myStuff

Put these in the card, and they will only trigger if no field text is 
selected. If you want it to trigger even if a field has the focus, then 
also use enterInField. You probably don't want to use returnInField 
though, because that would block carriage returns in the text.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list