• 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
Setting divider position of NSSplitView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting divider position of NSSplitView?


  • Subject: Setting divider position of NSSplitView?
  • From: Matt Gemmell <email@hidden>
  • Date: Sat, 20 Apr 2002 22:18:47 +0100

Hi all,

I need to make the position of an NSSplitView's divider persistent
between launches of my application. I have an NSTextView in the top half
of the splitview, and an NSTableView in the bottom half.

I've tried the following approaches, without success:

1. Subclassing NSSplitView and overriding the drawDividerInRect: method.
From this experiment, I learned that drawDividerInRect: actually only
draws the little grab-bar widget in the rect, not what I think of as the
"divider", i.e. the blank area between the tableview and the textview.

2. Using [tableview setFrame:] to try to tell the tableview to change
its size. I tried then telling it setNeedsDisplay:YES, and I also then
tried telling the splitview to adjustSubviews, but neither caused any
visual change.

In both case, I tried resizing the window afterwards, to check that it
wasn't just a problem with visual updating. I'm not sure where to go
next. My feeling is that I want to save and reload simply the height of
the upper view (the textview), and then use that to set the splitview's
divider, but I can't seem to get the splitview to actually change the
split position. No methods exist in NSSplitView to set the actual split
position, nor is there even a method to get the current rect of the
divider (though I've cobbled one up myself, using the splitview's frame
and the height of the upper view).

I seek enlightenment. :)

Best,
-Matt

--
Matt Gemmell
Scotland Software
<http://www.scotlandsoftware.com/>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Looking for HTML viewer method.
  • Next by Date: Re: [ANN] Cocoa Browser ver 0.3
  • Previous by thread: Re: Looking for HTML viewer method.
  • Next by thread: Correct way to determine machine's IP address in Cocoa
  • Index(es):
    • Date
    • Thread