• 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
IB palettes and [NSBezierPath setDefaultLineWidth:]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: IB palettes and [NSBezierPath setDefaultLineWidth:]
      • From: Buddy Kurz <email@hidden>
  • Prev by Date: Floating point problem???
  • Next by Date: Re: current user if started from /Library/StartupItems
  • Previous by thread: Floating point problem???
  • Next by thread: Re: IB palettes and [NSBezierPath setDefaultLineWidth:]
  • Index(es):
    • Date
    • Thread