Dynamically update drawRect
Dynamically update drawRect
- Subject: Dynamically update drawRect
- From: proger proger <email@hidden>
- Date: Sat, 26 Dec 2009 23:27:25 +0200
Hello,
I'm trying to write simple application with Core Graphics. My code:
@implementation MyView
- (id)initWithFrame:(NSRect)frameRect
{
self = [super initWithFrame:frameRect];
return self;
}
- (void)drawRect:(NSRect)rect
{
myContext = [[NSGraphicsContext currentContext]graphicsPort];
CGContextSetRGBFillColor (myContext, 1, 0, 0, 1);// 3
CGContextFillRect (myContext, CGRectMake (0, 0, 200, 100 ));// 4
}
- (void) dealloc
{
[super dealloc];
}
I have two classes. One for internet connection(program logic) and one to
display graphics(i posted code). And i want to call drawRect from another
class and pass some data to drawRect method. Seems like drawRect method is
just for static graphics. Does there's any possibility to do it ? Any
examples ?
_______________________________________________
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