Custom button behavior (was Windows appearance issues)

Ken Ray kray at sonsothunder.com
Wed Feb 11 14:56:35 EST 2004


> I used to provide for standard HIG button behavior (sliding 
> the cursor out unhilites, etc.) with "the mouse" (if the 
> mouse is within the rect of me...else...), but in Rev it 
> should probably be done with 'mouseMove'.
> 
> I can't seem to get the behavior to work right with 
> 'mouseMove'. Does anyone have a generic script?
> 
> Haven't had to deal with this before in Rev, because I just 
> worked Mac stuff.

Ken, you don't need to do this. You just need to create graphics for the
different states of your button, then create a transparent button and:

1) set the "icon" of the button to the graphic that corresponds to its
normal (unclicked or "up") state
2) set the "hiliteIcon" of the button to the graphic that corresponds to
its depressed (or "down") state

These will make it act like a true buttton (i.e. if you mouse down and
slide out of the button, it will return to its normal state until you
mouse back in and it goes back to its "down" state)

3) (optional) if you want a different graphic for the state of the
button when it's disabled, set the "disabledIcon" of the button to the
graphic that corresponds to the disabled state

4) (optional) if you want a different graphic for the state when the
mouse is moved into and over the button but the mouse is not down (it's
"rollover" state), set the "armedIcon" of the button to the graphic that
corresponds to the rollover state


HTH,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 




More information about the use-livecode mailing list