In which cases "colorchanged" message is sent

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

In which cases "colorchanged" message is sent

Post by jmburnod » Thu Jan 11, 2018 6:18 pm

Hi All,
I noticed that a "colorchanged" message is sent when i use dropper tool, but not when i set the brushcolor.
Is there other cases where "colorchanged" message is sent ?
I found something about it in dictionary (lc 8.1.6) but nothings comes.(i saw it in messages watcher)
Best regards
Jean-Marc
https://alternatic.ch

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: In which cases "colorchanged" message is sent

Post by LCMark » Thu Jan 11, 2018 6:52 pm

@jmburnod: The colorChanged message is specific to the dropper tool - it is the message it uses to communicate the color selected by the dropper.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: In which cases "colorchanged" message is sent

Post by jmburnod » Thu Jan 11, 2018 6:58 pm

Thanks for this quick answer
https://alternatic.ch

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: In which cases "colorchanged" message is sent

Post by Klaus » Thu Jan 11, 2018 7:07 pm

First time I heard of this message!? :shock:

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: In which cases "colorchanged" message is sent

Post by jmburnod » Thu Jan 11, 2018 9:24 pm

Hi Klaus,
First time I heard of this message!? :shock:
Probabily because few people work for paint app. :(
Same for bucket issue.
Kind regards
Jean-Marc
https://alternatic.ch

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: In which cases "colorchanged" message is sent

Post by FourthWorld » Thu Jan 11, 2018 9:42 pm

Oh, but it's for so much more than paint operations. Anything in which the user can set colors for any object can benefit from this message.

FWIW I've never heard of it before either. It's not in the v8.2 Dictionary, and I can't check v9 since the Dictionary there doesn't load on Linux - when was that introduced?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: In which cases "colorchanged" message is sent

Post by Klaus » Thu Jan 11, 2018 9:52 pm

Hi Richard,

it is not in the dictionary of LC 9 dp 11, but also not in the dictionary of LC 5.02.
I wonder how many other undocumented gems might be in LC?


Best

Klaus

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: In which cases "colorchanged" message is sent

Post by FourthWorld » Thu Jan 11, 2018 10:22 pm

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: In which cases "colorchanged" message is sent

Post by jmburnod » Thu Jan 11, 2018 11:13 pm

Oh, but it's for so much more than paint operations. Anything in which the user can set colors for any object can benefit from this message.
I tested:
brushcolor no sent
backgroundcolor no sent
textcolor no sent

It seems indeed only dropper tool sends colorchanged message
https://alternatic.ch

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: In which cases "colorchanged" message is sent

Post by LCMark » Fri Jan 12, 2018 7:16 pm

As I said above - the 'colorChanged' message is how the *dropper* tool communicates the color that was chosen (I must confess I wasn't aware of it until I searched for it in the source!) - if it didn't send a message the tool wouldn't do anything useful (how would you know what color had been chosen?).

The dropper tool is a user-initiated action (beyond choosing the tool) - so that's why it sends a message.

The only way to set the a color of an object in LC is in script - which has to be scripted, and if you've scripted it you know you've changed it - hence they don't send a message.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”