Re: clearing NSView outside of drawRect:

2008-09-12 Thread Graham Cox
On 13 Sep 2008, at 10:21 am, Graham Cox wrote: If you are using the rect to select objects, you can also pass it to other methods that find which objects it touches or encloses. To be clear - of course you'd do this in step (2), not step (3), then *draw* the feedback of being in a select

Re: clearing NSView outside of drawRect:

2008-09-12 Thread Graham Cox
On 13 Sep 2008, at 1:29 am, Chinh Nguyen wrote: My selection is several pixels behind my mouse as I'm dragging it when I use setNeedsDisplay: This suggests you're handling the drag loop incorrectly. There's no reason this should be the case when using setNeedDisplay: - if you organise y

Re: clearing NSView outside of drawRect:

2008-09-12 Thread Chinh Nguyen
On Sep 11, 2008, at 10:16 PM, Ken Ferry wrote: If I read this correctly, you're hoping that you can erase some of the drawing done in your overlay view, just revealing the original drawing in your complex background view. You can get the effect you want in layer backed mode (c.f. -[NSView s

Re: clearing NSView outside of drawRect:

2008-09-11 Thread Ken Ferry
If I read this correctly, you're hoping that you can erase some of the drawing done in your overlay view, just revealing the original drawing in your complex background view. That won't work (with some caveats about layer-backed mode). All views draw into one flat buffer, called the window backin

Re: clearing NSView outside of drawRect:

2008-09-11 Thread Michael Ash
On Thu, Sep 11, 2008 at 5:09 PM, Chinh Nguyen <[EMAIL PROTECTED]> wrote: > How do you clear an NSView when drawing outside of drawRect:? Don't. Drawing outside of drawRect: is, essentially, wrong. There are extremely rare cases where it makes sense, but in virtually all cases, if you suddenly feel

clearing NSView outside of drawRect:

2008-09-11 Thread Chinh Nguyen
How do you clear an NSView when drawing outside of drawRect:? I added and positioned a custom view on top another view (addSubView:positioned:relativeTo:) that draws a complex image so that I can draw selections in my custom view without having to worry about redrawing my original image or