'Duplicating' a section of an NSView...
'Duplicating' a section of an NSView...
- Subject: 'Duplicating' a section of an NSView...
- From: Rachel Blackman <email@hidden>
- Date: Tue, 26 Dec 2006 13:34:37 -0800
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? :)
--
Rachel 'Sparks' Blackman -- sysadmin, developer, mad scientist
"If it is not broken, give me five minutes to redesign it!"
_______________________________________________
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