Setting the value of a button hilite in script

J. Landman Gay jacque at hyperactivesw.com
Wed Dec 14 01:11:19 EST 2011


On 12/13/11 11:37 PM, Mark Wieder wrote:
> Pete-
>
> Tuesday, December 13, 2011, 5:23:11 PM, you wrote:
>
>> Hi Mark,
>> That's where I started - I added the parens to see if it made any
>> difference.  I just tried it again without the parens and still get the
>> same error.  Wonder if it's a version thing - I'm on 4.6.4
>
> I did that on 4.6.4 as well. 5.0 is too buggy for me. It worked from
> the message box.
>

I just tried it in 5.0.2 and it works both with and without parentheses. 
I made a radio button with a cHilite property set to true. I made a 
pushbutton with this script:

on mouseUp
   set the hilite of btn 1 to (the cHilite of btn 1)
   set the cHilite of btn 1 to not the cHilite of btn 1
end mouseUp

Repeatedly clicking the pushbutton toggles the hilite. Removing the 
parentheses also worked.

If that doesn't work in 4.6.4 then you could try indirection:

on mouseUp
   get the cHilite of btn 1
   set the hilite of btn 1 to it
   set the cHilite of btn 1 to not the cHilite of btn 1
end mouseUp

Pete, test with a known button rather than "control x". If that works, 
then the problem is probably elsewhere. You shouldn't have to load the 
compiler (which is what "do" does) just to set a hilite.

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




More information about the use-livecode mailing list