[Drawkit] two views, different layers?

Graham Cox graham.cox at bigpond.com
Tue Jul 29 18:05:39 PDT 2008


In your view's mouseDown: method, you can set the active layer "just  
in time" then continue with normal processing. Switching the active  
layer is usually a cheap process (as it's only changing a pointer and  
sending a couple of notifications) so you're unlikely to run into  
performance issues. And if the layer you want is already active, DK  
does nothing, so you don't even need to test for it - just set it and  
go.

cheers, Graham


On 30 Jul 2008, at 3:42 am, James Maxwell wrote:

> Does anyone know if there's a built-in mechanism to set the active  
> layer using the view? Since I have two object drawing layers which  
> are intended to be exclusive to their own views, I'd like to be able  
> to automatically set a given layer to "active" when mouse events are  
> sent by a given view.
> So, click view A --> activate layer A, click view B --> activate  
> layer B.



More information about the Drawkit mailing list