views:

34

answers:

1

I want to create a scrollview with a zooming control and a button next to the scrollbar. Sort of like the "tile window" button in XCode (top right corner of the editor), it should be in the same box that usually is used by the scrollbar only.

Do you have an idea of how to approach this?

I was thinking to use an NSScrollView and set the scrollbars to a custom subclass of NSScroller which includes the other widgets. What kinds of buttons use the same style as the scrollbar?

+1  A: 

Subclass NSScrollView and override -tile. You'll add the subviews on -init... or nib awake (or some other convenient time) and lay out the controls manually in your overridden -tile method. If you call [super tile] first, then adjust the bottom or right scroll bar to make room for your custom control(s), your job will be a lot easier.

Joshua Nozzi
`- init` won't work since nibs unarchived, not initialized.
BastiBechtold
Which is why I mentioned "or nib awake". :-) I knew the moment I left out -init... you'd say "I'm creating it dynamically," so I mentioned both. :-)
Joshua Nozzi