IB palettes and [NSBezierPath setDefaultLineWidth:]
IB palettes and [NSBezierPath setDefaultLineWidth:]
- Subject: IB palettes and [NSBezierPath setDefaultLineWidth:]
- From: Pete Yandell <email@hidden>
- Date: Tue, 4 Feb 2003 13:30:31 +1100
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.