[Drawkit] two views, different layers?

Graham Cox graham.cox at bigpond.com
Mon Jul 28 17:37:10 PDT 2008


On 29 Jul 2008, at 2:01 am, James Maxwell wrote:

> Well, this is what I was wondering about yesterday - the idea of  
> having one view draw only layers A, B, C, and another draw only  
> layers A, B, D. That would be great. You mentioned the idea of  
> tweaking drawRect a little to ask the view which layers to draw. Is  
> that still your recommendation?


I'm not really "recommending" anything. There are several possible  
ways to implement what you need, so you'll need to figure out what's  
best for your app. If you can avoid subclassing the layer that might  
be a good idea (unless you are doing so for other reasons anyway), but  
somewhere you'll have to subclass something, be it the layer or the  
view or both. Possibly the view-only scheme could be simplest, and  
least likely to get tripped up by something that DK expects to be a  
certain way. In MVC terms this is probably cleanest too.

You might have to try different ideas until the right solution becomes  
obvious by natural selection ;-)

cheers, Graham


More information about the Drawkit mailing list