I use several observers in my extension that keep track of whether a component is selected.
I use the SelectionObserver.
The onSelectionBulkChange is triggerd when the user has selected a component in the model and updates the interface.
Now I notice that when I select a component via the Outliner the SelectionObservers are not triggerd, even though the component is selected.
Am I missing something?
I would still expect the SelectionObserver to be triggered when I select a component, even if it is through the Outliner.
Use a polling observer to test what callbacks the SketchUp engine is checking for, with various activities.
class PollingSpy
def self.attach(obj)
obj.add_observer( self::new(obj) )
end
def initialize(obj)
@obj = obj
end
def detach()
@obj.remove_observer(self)
@obj = nil
end
def respond_to?(meth)
puts "SketchUp polled #{self.class}:#{self.inspect}"
puts " for a #{meth.to_s} callback,"
puts " fired upon object: #{@obj.inspect}"
super(meth)
end
end