Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > A Pane or divided window?! How do I make one?

A Pane or divided window?! How do I make one?
Thread Tools
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
Jul 13, 2003, 11:31 AM
 
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
Reply With Quote
Jul 13, 2003, 04:11 PM
 
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
Reply With Quote
Jul 13, 2003, 05:46 PM
 
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
Reply With Quote
Jul 14, 2003, 07:24 PM
 
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
Reply With Quote
Jul 14, 2003, 10:32 PM
 
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
Reply With Quote
Jul 17, 2003, 10:53 PM
 
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.
Rick Roe
icons.cx | weblog
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:10 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2