Gradients on buttons?

Keith Clarke keith.clarke at clarkeandclarke.co.uk
Wed May 11 06:37:16 EDT 2011


Scott and Bernd, Thanks for confirming the situation with gradients on buttons. 

Scott - I'm just learning about behaviours, so thanks for clarifying that they are controlled by scripts on the target button (such as 'set the fillGradient [of graphic] to propertiesArray') rather than the properties of the behaviour target button itself. 
That explains why my behaviours aren't working too well - more lessons to lookup! :-)

So, I have created my first UI 'menu tab' button, with idle, hilite, armed and hover icons set as the imported image snapshots of graphics. I can't seem to align the button's name text correctly within the imported graphics, so I've added an overlaying field for the tab title. The only problem now is that the mouse location is not being passed to the underlying button when the mouse is over this Title field. I've tried adding the following script to the Title field but it's not working - any ideas?

on mouseEnter
   pass mouseEnter
end mouseEnter

on mouseLeave
   pass mouseLeave
end mouseLeave  

Best,
Keith..

On 11 May 2011, at 10:43, Scott Rossi wrote:

> Keith:
> 
> To me, it seems like you're talking about two different things here.  To
> create custom roundrect buttons, you're correct: you either need to import
> button images to use as icons on native button objects, or create buttons
> using roundrect graphics and/or groups.
> 
> When it comes to behaviors, native buttons are simply the containers that
> hold the behavior scripts for whatever objects they are assigned to --
> behaviors can be assigned to virtually any object in LiveCode.  I'm not sure
> why you would need to style/modify a behavior button with a gradient.
> 
> So your workflow could be to create your custom button object (graphic or
> group) and then place its operating script/s within the object itself, or
> set the object's behavior to a native button that contains the operating
> script/s.
> 
> Hope this helps.
> 
> Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX Design





More information about the use-livecode mailing list