Re: Proxy Window of another
Re: Proxy Window of another
- Subject: Re: Proxy Window of another
- From: Uli Kusterer <email@hidden>
- Date: Sun, 4 May 2008 15:53:05 +0200
Am 04.05.2008 um 13:25 schrieb Daniel:
Basically I wanted to display a window which modifies "graphically"
another window. Under graphically I mean for example zooming of some
parts of the window or change colors and so on and also to preserve
the funcionality of the original window.
So, basically you're trying to write a GUI editor, like Interface
Builder? In that case, I think what you'd really want to do is build
your view hierarchy slightly differently. It's been a while since I
tried writing a GUI editor in Cocoa, and I did half a dozen in Classic/
Carbon, so I may be mixing up things here, but there are several
approaches, all of which might work depending on what you want to do:
1) Use NSImage and NSBitmapImageRep's -initWithFocusedViewRect: method
to create a snapshot of each view. Then you can create a custom view
for each view that draws such a snapshot, accepts clicks, draws a
selected look, etc.
2) Wrap each view in a container view. I think there was some way to
make a view get clicks before its subviews get them. That way, you can
intercept the clicks and do something special with them when needed,
and also draw a highlight to indicate a selection.
Views are objects just like any other, so you can easily create a new
one using alloc/initWithFrame:, then use addSubview to insert it in
another view etc., and thus dynamically change the view hierarchy or
even build a completely new one, without a NIB. Same applies to
NSWindows.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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