Changing the Default Button

Sarah Reichelt sarah.reichelt at gmail.com
Mon Sep 26 17:32:27 EDT 2005


On 9/27/05, Dan Shafer <revdan at danshafer.com> wrote:
> I have a client who writes his own Rev code. He wants to change the
> Default button on a card as he goes from it to another card and then
> comes back.
>
> The UI updates correctly. The button says it's the default in the
> prop inspector. But hitting Return or Enter at that card does not
> activate the handler of the default button as it does for the default
> button in the original setup.
>
> What does he need to do that we're missing?
>

As far as I know, creating a default button only changes it's
appearance. It does not allocate any behavior to that button (although
I think it is supposed to). Your client needs to have an enterKey
handler and a returnKey handler and have them check which button is
set to default (use the defaultButton property) and activate it
directly.

If the default button can be activated while typing in a field, you
will need enterInField and returnInField handlers as well.

HTH,
Sarah



More information about the use-livecode mailing list