Re: 'Duplicating' a section of an NSView...
Re: 'Duplicating' a section of an NSView...
- Subject: Re: 'Duplicating' a section of an NSView...
- From: Ricky Sharp <email@hidden>
- Date: Tue, 26 Dec 2006 15:50:56 -0600
On Dec 26, 2006, at 3:34 PM, Rachel Blackman wrote:
I have encountered a situation where I have, basically, an NSView
and need to be able to create sub-NSViews off of pieces of that
NSView. In other words, I need to be able to take one (or more)
rectangle of that parent (hidden) NSView, and turn it into a
separate (visible) NSView for use elsewhere. The (visible) child
view needs to stay in-sync with the (invisible) parent view. To
clarify, the 'parent view' is a Flash application (embedded in a
WebKit view), which calls out (via the WebScriptObject) and gives
me locations to 'clip out' as windows.
No, I cannot redesign this thing. I've got to work with something
I was handed for this particular project. But abstractly, I've got
an NSView (containing some Flash 'gooey' stuff) which I need to
clip up into sub-pieces and display as windows, while keeping the
actual NSView hidden.
(I also need to pass NSEvent stuff on the sub-windows back to the
parent, obviously, but stealing all the mouse events and re-
generating them with the appropriate locations to pass on to the
parent doesn't seem /hugely/ problematic as of yet.)
I've been toying with NSImage/NSImageRep solutions, clipping chunks
of the hidden NSView out as images, but that's godawful slow and
doesn't seem very 'clean' to keep updated. I can't help but wonder
if there's something in Quartz that would help? (Unless someone
has a magic solution to turn an NSRect of a view into an OpenGL
surface, which I could then display elsewhere!)
I've been banging my head against this one for a couple days, so
thought I'd toss it out and ask if anyone had any thoughts? :)
Could each of the clips just contain the original embedded Flash, but
just clipped (i.e. set the size of the view as well as its origin to
only draw the appropriate rectangle). Now then, I have not played
around with Flash like this, so don't know what will happen when you
have multiple views all accessing the same content. I would assume
that you'd end up with n unique instances of the content and thus it
would then not be all synced together.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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