[General] Movement hook?
adam.spitz at gmail.com
Sun Jun 15 18:44:35 CEST 2008
Is this the right forum to ask little fiddly questions about LK?
I'm trying to use LK to build a little application that's basically a
bunch of boxes connected by lines. I want the two endpoints of each
line to stay attached to whichever box they're attached to (even if
those boxes move around). Right now I'm accomplishing this by checking
all the lines every N milliseconds to see whether the box at each end
has moved (and if it has then I update the vertices of the line
accordingly). That works OK, but it seems like an ugly solution, and
it's turning out to be a strain on the computer.
I was hoping that there'd be some method somewhere that gets called
every time a particular morph moves (whether that morph was itself
moved, or whether its owner or its owner's owner moved or whatever).
I've been looking through the source code and so far I haven't found a
method that looks like that (but it's very possible that I've missed
it). Methods like setBounds and translateBy seem almost like what I
need, except that (if I understand correctly) they only get called if
the morph itself is moved, not if its owner is moved. I could probably
hack something together that would sorta work, but I was hoping for
some advice from someone who's more familiar with LK.
More information about the lively-kernel