Removing observers
-
How do you remove observers? What is the argument to pass on?
I've been using an entities observer to monitor the enitites of the active path. Whenever the path changes I need to remove the observers watchign the old path. But now?
http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#remove_observer
The example in the manual doesn't give much of a clue. Just says observers. I tried passing my Observer class, but that didn't do anything. The remove_observer method return false every time. -
@tig said:
http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#remove_observer ?
That would be the same link I provided in my OP. It's not obvious to me what it does and what the
observeris.I've tried to make store the return value when I do MyEntitiesObserver.new (
myTemp = MyEntitiesObserver.new)And then I try
entities.remove_observer( myTemp )and that returns true. But the old observers still triggers...
-
http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#remove_observer ?
You need to pass the observer to the 'remove_'... You must have an entity_ or entities_observer ?
-
Ok. Found the problem. I was using
model.active_pathto cache the last path. When the last path was themodelitself it'd return an empty array.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement