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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to