disabling a group

Paul Hibbert paul at livecode.org
Wed Jan 13 22:29:00 EST 2021


I have just used setProp in a behaviour button that was assigned to several groups made up of two graphic controls to represent a toggle switch. By setting one custom property the whole appearance of the group can easily be changed. I predefined the colours for each state in more custom properties, I’m sure this could be adapted to suit your case.

Rather than explain everything in detail here, I have uploaded a stripped down stack to dropbox which I’m sure you could easily modify the behaviour script to change the appearance of your graphics in a similar way. If you need any more explanation, just ask, but I’m sure you will get the idea.

Dropbox Link; https://www.dropbox.com/s/misiog5bwathpgy/Toggle%20Switch.livecode?dl=0

Paul

> On 13Jan, 2021, at 1:04 PM, jbv via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Le 2021-01-13 15:34, Mark Wieder via use-livecode a écrit :
>> On 1/13/21 11:32 AM, jbv via use-livecode wrote:
>>> Hi list,
>>> I have a group that contains various controls, including graphic objects.
>>> When I disable the group, the colors of every object becomes lighter,
>>> except for graphics whose colors remain the same.
>>> What is the best way to make colors of graphics become lighter when the
>>> group is disabled ?
>>> I tried blending, but then the portions of other controls underneath the
>>> graphic become visible...
>> A thought:
>> You might try overlaying the group or the graphic objects with another
>> graphic rectangle, set the blending to make it translucent, and then
>> toggle the visibility of said rectangular graphic.
> 
> yes, I thought of that; but since I have 20 groups on my card, it will
> be simpler to add a line of script and change the graphic color when
> toggling between enable & disable.
> I was just wondering if there was a secret trick to disable the graphic
> and make it look disabled like the rest of the group.
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list