Re: Proxy Window of another

2008-05-04 Thread Uli Kusterer

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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Proxy Window of another

2008-05-04 Thread Daniel
On Sun, May 4, 2008 at 12:30 AM, Jean-Daniel Dupas
<[EMAIL PROTECTED]> wrote:
>
>  Override the -[NSWindow  sendEvent:] method and pass the event parameter to
> the target window sendEvent: method.
>

Thank you very much!


On Sun, May 4, 2008 at 12:34 AM, Jean-Daniel Dupas
<[EMAIL PROTECTED]> wrote:
>
> Sorry, I miss the first part. I don't think you can copy the content of a
> Window into another one.  What are you trying to do ?
>
>

On Sun, May 4, 2008 at 1:31 AM, Uli Kusterer
<[EMAIL PROTECTED]> wrote:
> Am 03.05.2008 um 23:45 schrieb Daniel Rampanelli:
>
>   What are you trying to do?
>
>   Usually, "content" translates to "model", "display" generally translates
> to "view", so according to the Model-View-Controller paradigm, you could
> create another instance of your controller that has its own copy of the
> views, but points at the same model, instead of forwarding events.
>
>   That's one of the advantages of Cocoa's MVC design: If you separate the
> view and the model code, you can easily have several windows showing the
> same data. It's also more flexible than just duplicating a window and
> forwarding its contents, because it can be scrolled to a different location,
> can have a different toolbar collapse state, can be a different size etc.
>
>  Cheers,
>  -- Uli Kusterer
>  "The Witnesses of TeachText are everywhere..."
>  http://www.zathras.de
>

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.
For example, if the Proxy Window displays a part of the original
Window (on which there is a button) on the Proxy Window we still can
use the "zoomed" button as it were the original one.

I hope I've mad myself clear ;-)

Daniel
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Proxy Window of another

2008-05-03 Thread Uli Kusterer

Am 03.05.2008 um 23:45 schrieb Daniel Rampanelli:
I was thinking wheter it is possible to create a sort of "proxy"  
window which displays the content of another. Of course, the further  
step would be to also pass events from the proxied window to the  
source one. Is this even possible?



 What are you trying to do?

 Usually, "content" translates to "model", "display" generally  
translates to "view", so according to the Model-View-Controller  
paradigm, you could create another instance of your controller that  
has its own copy of the views, but points at the same model, instead  
of forwarding events.


 That's one of the advantages of Cocoa's MVC design: If you separate  
the view and the model code, you can easily have several windows  
showing the same data. It's also more flexible than just duplicating a  
window and forwarding its contents, because it can be scrolled to a  
different location, can have a different toolbar collapse state, can  
be a different size etc.


Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Proxy Window of another

2008-05-03 Thread Jean-Daniel Dupas


Le 4 mai 08 à 00:30, Jean-Daniel Dupas a écrit :



Le 3 mai 08 à 23:45, Daniel Rampanelli a écrit :



Hi,
I was thinking wheter it is possible to create a sort of "proxy"  
window which displays the content of another. Of course, the  
further step would be to also pass events from the proxied window  
to the source one. Is this even possible?


Thanks in advance,
Daniel


Override the -[NSWindow  sendEvent:] method and pass the event  
parameter to the target window sendEvent: method.


Sorry, I miss the first part. I don't think you can copy the content  
of a Window into another one.  What are you trying to do ?


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Proxy Window of another

2008-05-03 Thread Jean-Daniel Dupas


Le 3 mai 08 à 23:45, Daniel Rampanelli a écrit :



Hi,
I was thinking wheter it is possible to create a sort of "proxy"  
window which displays the content of another. Of course, the further  
step would be to also pass events from the proxied window to the  
source one. Is this even possible?


Thanks in advance,
Daniel


Override the -[NSWindow  sendEvent:] method and pass the event  
parameter to the target window sendEvent: method.




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Proxy Window of another

2008-05-03 Thread Daniel Rampanelli


Hi,
I was thinking wheter it is possible to create a sort of "proxy"  
window which displays the content of another. Of course, the further  
step would be to also pass events from the proxied window to the  
source one. Is this even possible?


Thanks in advance,
Daniel
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]