 |
 |
A Pane or divided window?! How do I make one?
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status:
Offline
|
|
What's that UI element called that holds the playlist list on the left in iTunes? Is it a Pane? How do I make one? There doesn't seem to be a class for it in IB. Has anyone run across a tutorial for it? I tried a google search, but since I'm not sure what it is called it wasn't a very fruitful search.
kman
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2002
Status:
Offline
|
|
I think the iTunes one will be pretty much custom coded.
But you can emulate it by using a NSTableView, and not using headers. Then drawing your own with a custom view.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jul 2002
Status:
Offline
|
|
If you're talking about the resizable divider between the playlist and the main view, it's a "split view". You can make one in IB by selecting two views and going to Layout>Make Subviews Of.
Making the splitview is easy. Getting it to work in a sensible way (auto saving its position, collapsing/restoring on double click of the divider, etc etc) is not. But a lot of people have already answered those questions, go look on cocoa.mamasam.com.
The views inside the splitview in iTunes are just table views, but they have some added functionality, such as row dragging.
(Last edited by arekkusu; Jul 14, 2003 at 02:58 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
Hey, these NSSplitViews are really handy. I've just implemented it in one of my apps after reading this thread. I've got one question though.
How do you programatically determine the position of the divider, and then later (after quitting and restarting the application) restore the position of the divider?
There's a few delegate methods, but I don't see any useful instanse methods for this.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
Nevermind, I figured it out. You can save/restore the sizes of the various panes, simply by saving/restoring the frames of the subviews.
Or as much as is necessary, depending on your situation. I just needed to save the width of one subview, then restore that width, reposition the origin to 0, and make the second subview take up the rest of the space (allowing the the width of the divider).
It seems as though resizing a subview causes the NSSplitView to take care of the rest (ie, repositioning the divider).
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Shameless plug: See OASplitView and NSSplitView-OAExtensions in the open-source OmniAppKit framework for examples of how to more directly set some parameters of a splitview and implement position autosaving. Or just use it instead of NSSplitView to get all that for free.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|