• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Springs and struts with splitview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Springs and struts with splitview


  • Subject: Springs and struts with splitview
  • From: Kim Foo-Jones <email@hidden>
  • Date: Mon, 28 Jan 2002 19:19:27 +0000

I can't get my springs and struts to work in a splitview. I want the view on the left to stay the same size unless explicitly changed by the user and the right-side view to expand as necessary to fill the gap.

I've set up the springs and struts so it behaves correctly before putting them in the splitview, but after they're in the split view, the left-side insists on growing in proportion as the window resizes.

ASCII art will probably just confuse things, but here's how I have them set up:

Left View: Right View:
| |
___|___ ___|___
| * | | * |
---|--*--|*** and ---|*****|---
|__*__| |__*__|
| |
| |

(Where *** is a spring and --- is a strut)

I notice that NSSplitView has an adjustSubviews: method, which resizes the subviews proportionally. Do I have to subclass NSSplitView and override this to get the results I want?

In a separate issue (different window, different .nib), I also can't get it to have two views which always take up exactly half the window. Setting the springs like this:

Left View: Right View:
| |
___|___ ___|___
| * | | * |
---|*****|*** and ***|*****|---
|__*__| |__*__|
| |
| |

Gives almost what I want, but it tends to get seriously messed up after resizing the window a few times.

Does anyone know how to acheive the two effects I'm after? (Actually, to be more specific, I want to merge the two things together, so that I have one "fixed sized" (only the user should be able to resize it) pane on the left of a split view and four tiled views in the right part which should each take up a quarter of that pane. However, I thought I'd try and get this simpler case to work first...)

Thanks,

-Kim


  • Follow-Ups:
    • Re: Springs and struts with splitview
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: How viable is Cocoa development?
  • Next by Date: Re: theoretical idea - would this work?
  • Previous by thread: Re: What's the Real Story on Keys for NSDictionary
  • Next by thread: Re: Springs and struts with splitview
  • Index(es):
    • Date
    • Thread