• 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
Drawing into custom view from another object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing into custom view from another object


  • Subject: Drawing into custom view from another object
  • From: Nikita Zhuk <email@hidden>
  • Date: Thu, 22 Aug 2002 01:46:57 +0300

Hi there,

I have a custom view (a subclass of NSView, named "theView"), and I would like that another object would be able to draw NSBezierPaths into that view. This another object (let's call it "theShip") is a subclass of NSObject, so calling mePath = [NSBezierPath bezierPathWithRect:myRect]; and [mePath fill]; doesn't do a thing, of course (as it would in subclass of NSView). In a NSView subclass I would draw a simple blue rect like this:

[[NSColor blueColor] set];
myRect = NSMakeRect(x,y,20,20);
meBpath = [[NSBezierPath bezierPathWithRect:myRect] retain];
[meBpath fill];

So the question is, how can I draw things from theShip's function into theView? This is probably a pretty basic question, but I didn't find any helpful messages from mailing list archive.

--

******************************
* Nikita Zhuk
* MacZ Software
* WWW: http://www.maczsoftware.com
* E-mail: email@hidden
******************************
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Drawing into custom view from another object
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: NEWBIE: preferences - howto?
  • Next by Date: Re: years:months:days:hours:minutes:seconds:sinceDate: really slow!
  • Previous by thread: Re: NEWBIE: preferences - howto?
  • Next by thread: Re: Drawing into custom view from another object
  • Index(es):
    • Date
    • Thread