• 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
How to draw a rectangle in a NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to draw a rectangle in a NSView


  • Subject: How to draw a rectangle in a NSView
  • From: "Peter Karlsson" <email@hidden>
  • Date: Sat, 25 Sep 2004 12:19:23 +0200

Dear list!

I wonder if someone can show me how to draw a rectangle in a NSView? This
is very new to me so I need some help to get started.

I found this example...

NSRect r = NSMakeRect(10, 10, 50, 60);
NSBezierPath *bp = [NSBezierPath bezierPathWithRect:r];
NSColor *color = [NSColor blueColor];
[color set];
[bp stroke];

...but I can not figure out where I select the view to draw on. I do not
want it to autodraw. I want to place the code in an action.

Peter



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to draw a rectangle in a NSView
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: Direct pixel access
  • Next by Date: Re: Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?)
  • Previous by thread: Re: _validateBundleSecurity, _NSIsInsecureBundle, and dirIsRootUnsafe
  • Next by thread: Re: How to draw a rectangle in a NSView
  • Index(es):
    • Date
    • Thread