• 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
Calling drawRect: with alternate focus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Calling drawRect: with alternate focus


  • Subject: Calling drawRect: with alternate focus
  • From: David Newberry <email@hidden>
  • Date: Sat, 16 Nov 2002 23:26:26 -0800

Hi all,

I am currently playing around with a project where I'd like to have a variable number of controls gliding around from one position to another. This works fine, until you get more than just a few controls, after which is gets slower and slower (understandably). I'm unsure as to whether or not it would have an effect for the better, but what I thought I'd try doing is first drawing all my controls (while the animated transition from position to position is happening) into an NSImage, and then drawing that image to my NSView.

Since my controls are subclasses of NSViews, I can see two possible ways to get them into my NSImage. One would be to use dataWithEPSInsideRect:, create an NSImage with that data and draw that into my main NSImage. I'm pretty sure that would work, but it doesn't seem like the best solution.

The other idea I had was that maybe, just maybe, I could lockFocus on my NSImage and call the control's drawRect: method. It seems like this would work, assuming the focus system is shared by NSView and NSImage.

So first, is the second solution even possible? Also, if I'm missing something else or someone has any other suggestions, they would be most welcome.

Thank you all.

Peace,
-David Newberry
_______________________________________________
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.

  • Prev by Date: Re: Marketing your Cocoa App... Re: Jobs
  • Next by Date: Re: That Obj-C/Java Req -- Re: Jobs
  • Previous by thread: Re: Marketing your Cocoa App... Re: Jobs
  • Next by thread: how do I disable cell editing in NSTableView?
  • Index(es):
    • Date
    • Thread