best way to deal with resizable controls that can go to zero?

  • Hello,

    I'm a recent convert to Cocoa, and after a few months of development,
    I'm putting the finishing touches on my first Cocoa app.  One
    annoyance I've run into is dealing with resizable views and springs.
    The app has a sidebar that needs to collapse, and the controls within
    it are set to resize, but if the sidebar closes beyond the point
    where a control gets a width of 0, things go to pot.

    What is the best practice for working around this?  Is there a common
    solution?  I can handle all the resizing programmatically, but I'm
    hoping someone can offer an easier solution.

    mike
    --
    Mike Woodworth
    <mike...>
  • On 24 Sep 2007, at 1:36 PM, mike woodworth wrote:

    > I'm a recent convert to Cocoa, and after a few months of
    > development, I'm putting the finishing touches on my first Cocoa
    > app.  One annoyance I've run into is dealing with resizable views
    > and springs.  The app has a sidebar that needs to collapse, and the
    > controls within it are set to resize, but if the sidebar closes
    > beyond the point where a control gets a width of 0, things go to pot.
    >
    > What is the best practice for working around this?  Is there a
    > common solution?  I can handle all the resizing programmatically,
    > but I'm hoping someone can offer an easier solution.

    You have a situation in which the minimum size of the sidebar is
    greater than zero.

    You can still collapse the sidebar, even if a minimum size is set.
    Start following the documentation for NSSplitView at the delegate
    method splitView:canCollapseSubview: .

    — F
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today