• 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
[more coherent info] Re: Focus ring around NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[more coherent info] Re: Focus ring around NSTextField


  • Subject: [more coherent info] Re: Focus ring around NSTextField
  • From: Scott Anguish <email@hidden>
  • Date: Sun, 27 Oct 2002 17:43:10 -0500

it figures that after I send the monster message, I go back and search the Cocoa Controls example and find it right away.... I'm not having any luck finding this example outside of the WWDC downloads though.. .:-( Cocoa Controls Demo WWDC2K2

So, I guess you'd need to override the NSTextFieldCell, call setShowsFirstResponder:NO, inherit, and then set it back to what it was, and draw your own bezel.

- (void)drawClockHandsForTime:(NSCalendarDate *)theTime withFrame:(NSRect)cellFrame inView:(NSView *)controlView {

it implements

// If we have focus, draw a focus ring around the entire cellFrame (inset it a little so it looks nice).
if ([self showsFirstResponder]) {
// showsFirstResponder is set for us by the NSControl that is drawing us.
NSRect focusRingFrame = clockRect;
focusRingFrame.size.height -= 2.0;
[NSGraphicsContext saveGraphicsState];
NSSetFocusRingStyle(NSFocusRingOnly);
[[NSBezierPath bezierPathWithRect: NSInsetRect(focusRingFrame,4,4)] fill];
[NSGraphicsContext restoreGraphicsState];
}

which is called from

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Focus ring around NSTextField (From: Scott Anguish <email@hidden>)

  • Prev by Date: Splash Screen
  • Next by Date: [Solved] Images in table headers
  • Previous by thread: Re: Focus ring around NSTextField
  • Next by thread: Looking for bytes in NSData
  • Index(es):
    • Date
    • Thread