Changing backgroundColor of a button changes its style ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing backgroundColor of a button changes its style ?

Niggemann, Bernd via use-livecode
1. create a new stack

2. drag a 'standard button' from the toolbar onto it

(you now have a nicely rounded-corner button)

3. set its script to

on mouseup
    set the backgroundcolor of me to "200,50,50"
end mouseup

4, click on 'browse mode' so the stack is "live"

4a. observe the button still has nicely rounded corners :-)

5. click on it

  the backgroundcolor changes to red

AND the rounded corners disappear - it's now a rectangular button.

What am I doing wrong or missing ?

(LC 9.0.0, MacOS 10.13.2)

Thanks

Alex.



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Changing backgroundColor of a button changes its style ?

Niggemann, Bernd via use-livecode
Alex Tweedly wrote:
 > 1. create a new stack
 > 2. drag a 'standard button' from the toolbar onto it
 > (you now have a nicely rounded-corner button)
 > 3. set its script to
 >
 > on mouseup
 >     set the backgroundcolor of me to "200,50,50"
 > end mouseup
 >
 > 4, click on 'browse mode' so the stack is "live"
 > 4a. observe the button still has nicely rounded corners :-)
 > 5. click on it
 >
 >   the backgroundcolor changes to red
 >
 > AND the rounded corners disappear - it's now a rectangular button.
 >
 > What am I doing wrong or missing ?

If you apply a non-standard color, it's no longer a standard button.

We have a roundrect style that may work for the type of non-standard
button you're looking for.

But AFAIK the "standard" button relies on OS routines to render its
shape, gradient fill, etc., and the OS APIs provide little support for
non-HIG alterations.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Changing backgroundColor of a button changes its style ?

Niggemann, Bernd via use-livecode
On 18/06/2018 18:17, Richard Gaskin via use-livecode wrote:

> >
> > What am I doing wrong or missing ?
>
> If you apply a non-standard color, it's no longer a standard button.
>
> We have a roundrect style that may work for the type of non-standard
> button you're looking for.
>
I should probably take it as a good reason why I shouldn't be changing
the button colour :-)
> But AFAIK the "standard" button relies on OS routines to render its
> shape, gradient fill, etc., and the OS APIs provide little support for
> non-HIG alterations.
>
OK - UI changed to something better .... Thank You !

-- Alex.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode