• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSWindow, Drag and Drop, Focus Ring
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: NSTimeZone's localTimeZone (vs defaultTimeZone)?
  • Next by Date: Bounds resizing
  • Previous by thread: NSWindow, Drag and Drop, Focus Ring
  • Next by thread: Re: NSWindow, Drag and Drop, Focus Ring
  • Index(es):
    • Date
    • Thread