I just want to turn off button hiliting...

Richard Gaskin ambassador at fourthworld.com
Sat Jun 5 01:32:52 EDT 2004


Howard Bornstein wrote:

> Here's a problem with hiliting I've run into with buttons. I create a 
> button, set its style to rectangle (or standard) and turn off hiliting 
> in the object inspector. If I click the button, no problem, it doesn't 
> hilite. However, if I put this script into the button:
> 
> on mousestilldown
>   set the loc of me to the mouseloc
> end mousestilldown
> 
> The button will follow the mouse around BUT it also hilites and stays 
> hilited. If I test the button in the msg box (put the hilite of btn 
> "test") it returns false. If I say in the msg box, "set the hilite of 
> btn "test" to false" I don't see any change.
> 
> If I add this mouseup handler:
> 
> on mouseup
>   set the hilite of me to false
> end mouseup
> 
> it remains hilited.
> 
> However, if I replace it with this mouseup handler:
> 
> on mouseup
>   set the hilite of me to true
>   set the hilite of me to false
> end mouseup
> 
> Then the hilite is removed.
> 
> What I really want to do is just drag the button around with the mouse 
> without it ever hiliting.
> 
> Anybody have an idea why this is happening?

Is the style of the button rectangle or standard and you're using OS X? 
  If so, welcome to Macintosh:  Apple has decided that buttons will 
always hilite, regardless of trivial little things like what a developer 
may want, so buttons drawn by the OS will have the hilite.

If you don't need the Apple-specific appearance you can just set the 
style to anything other than standard, and if the style is rectangle 
just set the backgroundColor to tell the engine to draw using its 
internal routines.  The engine will faithfully deliver what you want; it 
was designed with the philosophy Apple helped popularize but sometimes 
forgets:  the user is in control.

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________
  Rev tools and more:  http://www.fourthworld.com/rev



More information about the use-livecode mailing list