[General] Why doesn't an 'accept changes' on border colour affect the colour?
Daniel.Ingalls at sun.com
Tue Mar 25 00:04:30 CET 2008
>Unfortunately, I am still not quite getting this. Based upon what you wrote, I understand the inspector reports the current property values for the instance. I can edit the properties, but they don't have any impact unless and until the object checks its own properties - presumably as a result of some event such as onMouseOver. That all makes sense.
>None of these worked, so I am obviously missing the obvious. Could you enlighten me please
No problem. In the absence of adequate documentation (to which we readily confess) your best bet is to search the code base. There you will discover, either through usage or comments in the code, that setFill expects its argument to be a Color or a Gradient (Linear or Radial).
I believe the correct way to write your example is
this.setFill(new Color(1, 0, 0)); // We use 0..1 instead of 0..255.
Hope this helps. I've CC'd the list in case this kind of info may be useful to others.
>On 24 Mar 2008, at 13:26, Dan Ingalls wrote:
>>Andy Burnett asked...
>>>Changing e.g. fishEye to true, changes the object behaviour. However, setting the rgb() value to something new has no effect. How come?
>>Hello, Andy -
>>However if you want a morph's color to change, you should use the setFill() method. This will take care of the necessary and appropriate propagation of change so that the SVG graphic routines get appropriately informed.
>>In general we favor a procedural interface for such changes. We have toggleFisheye(), but should probably also have setFisheye(trueOrFalse).
>>Hope this helps
>> - Dan
More information about the lively-kernel