Calling drawRect: with alternate focus
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.