Check-box & radio button

Jeanne A. E. DeVoto jeanne at runrev.com
Sat Apr 13 05:49:08 EDT 2002


At 11:01 PM -0700 4/10/2002, Steve L wrote:
>How can you set up a check-box or radio type button to
>retain it's selection status (selected or deselected),
>so that when you reopen the stack it will show the
>saved selection status.

If you're saving the stack, the highlight state will be retained and will
still be there when you re-open it. If you're not saving the stack (for
example, if it's a standalone, which can't be saved), you'll need to save
the information somewhere - in a file, in another stack, etc. - and then
restore it when you open the stack.

If you can give more info I may be able to get more specific with an
example handler.

>On a field, I know that you script:
>
>on closefield
>Set the udirty to true
>end closefield

I suspect you got this from the Employee Database example, but this isn't
exactly what's going on. The Employee Database asks you whether to save
changes when you close the stack. To do this, it needs to figure out
whether there are changes that need to be saved. When a field's text is
changed, it sets the uDirty of the stack to true; then when you close the
stack, the closeStack handler checks whether the uDirty property is set to
true, and if it is, the handler knows there are changes that need to be
saved.

But this is all scripted behavior, and is specific to the Employee
Database. The uDirty is a custom property used by those scripts, and could
be called anything. It's not automatic.

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
Runtime Revolution Limited - The Solution for Software Development
http://www.runrev.com/





More information about the use-livecode mailing list