• 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
Dynamically update drawRect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Dynamically update drawRect
      • From: Gideon King <email@hidden>
  • Prev by Date: Source List Indentation Drawing Issue
  • Next by Date: Re: n00b Q re: AppController
  • Previous by thread: Re: Source List Indentation Drawing Issue
  • Next by thread: Re: Dynamically update drawRect
  • Index(es):
    • Date
    • Thread