How to implement a "Picture Frame" view
How to implement a "Picture Frame" view
- Subject: How to implement a "Picture Frame" view
- From: "Albert Andersen" <email@hidden>
- Date: Tue, 8 May 2007 12:03:01 -0700
I am trying to implement a sort of 'picture frame' around the clip
view in an NSScrollView. Basically, I want to be able to draw on top
of the content of a scroll view, track changes to the view's size
(including shrinking when the scroller appears), but still interact
with the contents of the scroll view through the transparent portions
of the picture frame.
I have tried a few things, none of which have worked:
1) subclassed NSClipView, and changed drawRect to call [super
drawRect:] and then draw the picture frame. My custom drawRect method
was never called.
2) Made the picture frame a sibling view of the scroller's content
view, which listened for frameChangedNotifications from the content
view. Drawing worked most of the time, but no clicks would make it to
the enclosed table view.
3) Made the picture frame a child of the scroller's content view. This
drew all right, but the frame scrolls along with the enclosed table
view. Also, clicks aren't getting through to the table view.
4) Enclosed the ScrollView in an NSBox subclass that tracks the frame
of the clipView and draws the frame. In this case, the scroll view
just drew over the frame, because it is drawn after my custom NSBox.
Does anyone have any ideas on how to do this?
_______________________________________________
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