[self-interest] Re: Inheritance
Jecel Assumpcao Jr
jecel at merlintec.com
Wed Nov 26 18:15:38 UTC 2003
On Wednesday 26 November 2003 07:21, helenameyer2000 wrote:
> The slot target in the sliderMorph is set to the object
> pluggableOutliner, so our problem is that it is set to
> "pluggableOutliner" insted of "a pluggableOutliner"
> Our implementation of method addSlider:
> buildSliderTarget: pluggableOutliner
> Selector: 'scroll:'
> Color: color asEnhanchedColorForBackground: color
> And implementation of buildSliderTarget: t ...
The code I snipped away looks just fine, but shouldn't it be called from
addSlider this way:
Color: color asEnhanchedColorForBackground: color
In your version you are setting the target always to the same object
(pluggableOutliner) independently of who is executing the code.
> Regarding the second issue:
> We have tried to write "target changed", and now the object is
> redrawn in an other position, but the screen is not updated (you can
> still see the old version of the object...).
> How do we remove the old object?
You have two choices: you can make the whole screen be redrawn (target
owner changed) or you can send 'changed' to target twice (once before
it is moved and again after it is moved).
I haven't tested either solution, but if both work I would expect the
second one to be faster.
Nothing is redrawn automatically in Morphic (Self's graphic framework).
When objects notice that they have changed, they add their bounds to a
"damage region". Eventually, everything inside the damage region is
redrawn and we start building a new damage region again for the next
Adding the whole world to the damage region gets the job done, but will
have a terrible performance.
Adding the original area of the morph (which now should show any
previously covered morphs or the background) and the new area of the
morph will redraw the fewest possible bits that still give your the
correct image. It is easy to get things slightly wrong ("off by one"
errors, for example) and have morphs leave a trail of "dirty pixels" as
they move around on the screen.
Actually, there might be other choices beyond these two. I haven't
looked very deeply into this issue.
More information about the Self-interest