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

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.

  • Follow-Ups:
    • Re: IB palettes and [NSBezierPath setDefaultLineWidth:]
      • From: Pete Yandell <email@hidden>
References: 
 >IB palettes and [NSBezierPath setDefaultLineWidth:] (From: Pete Yandell <email@hidden>)

  • Prev by Date: Re: current user if started from /Library/StartupItems
  • Next by Date: Re: Setting the action for a menu item
  • Previous by thread: IB palettes and [NSBezierPath setDefaultLineWidth:]
  • Next by thread: Re: IB palettes and [NSBezierPath setDefaultLineWidth:]
  • Index(es):
    • Date
    • Thread