Page 1 of 1

In which cases "colorchanged" message is sent

Posted: Thu Jan 11, 2018 6:18 pm
by jmburnod
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

Re: In which cases "colorchanged" message is sent

Posted: Thu Jan 11, 2018 6:52 pm
by LCMark
@jmburnod: The colorChanged message is specific to the dropper tool - it is the message it uses to communicate the color selected by the dropper.

Re: In which cases "colorchanged" message is sent

Posted: Thu Jan 11, 2018 6:58 pm
by jmburnod
Thanks for this quick answer

Re: In which cases "colorchanged" message is sent

Posted: Thu Jan 11, 2018 7:07 pm
by Klaus
First time I heard of this message!? :shock:

Re: In which cases "colorchanged" message is sent

Posted: Thu Jan 11, 2018 9:24 pm
by jmburnod
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

Re: In which cases "colorchanged" message is sent

Posted: Thu Jan 11, 2018 9:42 pm
by FourthWorld
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?

Re: In which cases "colorchanged" message is sent

Posted: Thu Jan 11, 2018 9:52 pm
by Klaus
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

Re: In which cases "colorchanged" message is sent

Posted: Thu Jan 11, 2018 10:22 pm
by FourthWorld

Re: In which cases "colorchanged" message is sent

Posted: Thu Jan 11, 2018 11:13 pm
by jmburnod
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

Re: In which cases "colorchanged" message is sent

Posted: Fri Jan 12, 2018 7:16 pm
by LCMark
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.