• 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: Using selectedMenuItemColor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using selectedMenuItemColor


  • Subject: Re: Using selectedMenuItemColor
  • From: Graham Cox <email@hidden>
  • Date: Mon, 11 Apr 2011 12:09:33 +1000

On 11/04/2011, at 11:33 AM, Eric Gorr wrote:

> Hummm...I can't seem to get it to do much. If I alter the code to:


Have you tried using NSAffineTransform to offset the coordinate system to where you want to draw? You probably don't need or want to mess with your view coordinates or frame, you just need to move the coordinate system around within the view using the CTM.

e.g. if you want to highlight the rect <hr> (typed into mail, untested):

NSRect hr = NSMakeRect( 100, 100, 200, 120 );

[NSGraphicsContext saveGraphicsState];

NSAffineTransform* tfm = [NSAffineTransform transform];
[tfm translateXBy:hr.origin.x yBy:hr.origin.y];
[tfm concat];

hr.origin = NSZeroPoint;

NSRectFill( hr );

[NSGraphicsContext restoreGraphicsState];



So you offset to the rect origin, then draw at 0,0.

--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using selectedMenuItemColor
      • From: Eric Gorr <email@hidden>
References: 
 >Using selectedMenuItemColor (From: Eric Gorr <email@hidden>)
 >RE: Using selectedMenuItemColor (From: Lee Ann Rucker <email@hidden>)
 >Re: Using selectedMenuItemColor (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: Using selectedMenuItemColor
  • Next by Date: Re: Using selectedMenuItemColor
  • Previous by thread: Re: Using selectedMenuItemColor
  • Next by thread: Re: Using selectedMenuItemColor
  • Index(es):
    • Date
    • Thread