Re: Flipping over coordinate conversion
Re: Flipping over coordinate conversion
- Subject: Re: Flipping over coordinate conversion
- From: James Bucanek <email@hidden>
- Date: Wed, 26 Apr 2006 14:53:23 -0700
glenn andreas wrote on Wednesday, April 26, 2006:
>
>On Apr 26, 2006, at 2:50 PM, James Bucanek wrote:
>
>> glenn andreas wrote on Wednesday, April 26, 2006:
>>
>>> Then what you want isn't the frame (i.e., it's coordinates in the
>>> superclass view space) so much as the visibleRect of the view.
>>
>> You're right, but I couldn't get that to work. I realize now that
>> my problem was that my child window is listening for the
>> NSViewFrameDidChange notification. Unfortunately, this message is
>> not fired when the view is hidden, so my child window doesn't
>> update if the view disappears entirely.
>>
>> Do you know of anyway of getting notified when a view is hidden or
>> its visibleRect changes? Nothing on the list of notifications
>> documented for NSView would seem to fit the bill.
>
>Assuming it is a custom subclass of some NSView, you could always
>post a notification yourself when setHidden: is called. You might
>need to listen for both NSViewBoundsDidChangeNotification and
>NSViewFrameDidChangeNotification (as well as whatever you post during
>setHidden:), though you may get some false positives (i.e.,
>visibleRect doesn't always change when either bounds or frame are
>changed).
Good suggestions, although in this case the view I'm interested in isn't a custom subclass of NSTableView. (I have this idea that I'd like to reuse this code for some similar situations, so I'm trying to keep it as generic as possible.)
In the end I just punted and added a listener for NSSplitViewDidResizeSubviews too. This solves all of my problems without any additional plumbing. I also moved my visibleRect translation into a catagory of NSView, where it should have been in the first place. ;)
Cheers,
James
--
James Bucanek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden