Re: How to draw a rectangle in a NSView
Re: How to draw a rectangle in a NSView
- Subject: Re: How to draw a rectangle in a NSView
- From: Gregory Weston <email@hidden>
- Date: Sat, 25 Sep 2004 11:15:42 -0400
On Sep 25, 2004, at 9:30 AM, Peter Karlsson wrote:
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...
[[NSColor blueColor] set];
[[NSBezierPath bezierPathWithRect:NSMakeRect(10, 10, 50, 60)] 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.
Depending on what you're really trying to accomplish, it may be most
appropriate to simply invalidate the view in the action and then do the
drawing in drawRect: as normal. Otherwise, check out lockFocus in
NSView.
_______________________________________________
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