Re: IB palettes and [NSBezierPath setDefaultLineWidth:]
Re: IB palettes and [NSBezierPath setDefaultLineWidth:]
- Subject: Re: IB palettes and [NSBezierPath setDefaultLineWidth:]
- From: Buddy Kurz <email@hidden>
- Date: Mon, 3 Feb 2003 19:43:24 -0800
I'm thinkin' that since setDefaultLineWidth is a class method and not
an instance method that the defaults are stored in the NSBezierPath
class and not in the graphics context and you need to save the
individual defaults yourself or create an instance and change the
values in your instance.
On Monday, February 3, 2003, at 06:30 PM, Pete Yandell wrote:
I'm building some custom controls along with an Interface Builder
palette for them and am having a weird problem.
A cell for my control, in its drawInteriorWithFrame:inView: method,
does the following:
[[NSColor blackColor] set];
[NSBezierPath setDefaultLineWidth:2.0];
[NSBezierPath strokeLineFromPoint:pointA toPoint:pointB];
The problem I'm having is that when I load the palette containing this
control into IB and create a window containing an instance of the
control, the IB alignment guides in the window go from being single
pixel wide dotted blue lines to being two pixel wide solid blue lines!
Evidently my control is mucking up the graphics context for the window
and IB is using that context to draw its guides. So, I figured I'd
just save and restore the graphics context:
- (void)drawInteriorWithFrame:(NSRect)frame inView:(NSView*)view
{
[NSGraphicsContext saveGraphicsState];
...
[NSGraphicsContext restoreGraphicsState];
}
Strangely enough, this doesn't help...I still get two pixel wide solid
blue guides.
Anybody have any good ideas on what I should do?
Pete Yandell
http://pete.yandell.com/
_______________________________________________
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.
_______________________________________________
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.