Re: NSWindow, Drag and Drop, Focus Ring
Re: NSWindow, Drag and Drop, Focus Ring
- Subject: Re: NSWindow, Drag and Drop, Focus Ring
- From: Sanford Selznick <email@hidden>
- Date: Sun, 21 May 2006 07:57:39 -0700
At 12:01 AM -0700 5/21/06, I wrote:
Using draggingEntered, draggingExited, concludeDragOperation, what's
the best way to draw a focus ring just inside the edge of my window
(content area)?
Here's my solution: I moved all my drag and drop functions from my
NSWindow subclass to an NSView subclass. I set up this class to be
the NSWindow's content view in IB.
In draggingEntered, draggingExited, concludeDragOperation I set a
state variable named 'drawFocusRing' as YES, NO, and NO, respectively
and then call -display on the view. Then in the drawRect in the view
I do:
- (void)drawRect:(NSRect)rect {
[super drawRect:rect];
if (drawFocusRing) {
NSSetFocusRingStyle(NSFocusRingOnly);
NSRectFill(rect);
}
}
Seems to work well enough.
Best,
Sanford
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden