[more coherent info] Re: Focus ring around NSTextField
[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.