NSBrowser desired size
NSBrowser desired size
- Subject: NSBrowser desired size
- From: "Nick Kocharhook" <email@hidden>
- Date: Tue, 17 Sep 2002 22:58:13 -0700
I have an NSBrowser that's in an NSSplitView. I'd like to adjust the
splitView so that the browser fits exactly, with all cells displayed
fully and the vertical scroll bar inactive, but without excess space.
The browser has only one column and all cells are leaves.
I have tried many, many things. Here's a list of my attempts:
* approximating the cell height to about 18 (17.75 was too small, but
anything else was too big with more than ~10 cells) and then multiplying
by the number of cells in the column
* get the browser's -cellProtoype and ask for its height (it said 17 --
too small), then multiply by the number of cells in the column
- the above, but adding the splitView's dividerThickness to the top of
the fraction fed to splitView's -setFraction: (this left a large space
at the bottom, so it doesn't appear to be taking the divider into account)
- the above, but adding some arbitrary constant (presumably for
intercell spacing) to the multiplied value. This produced the closest
results, but it was still clearly off, especially when the number of
rows exceeded 10 or so.
* ask the browser to -sizeToFit and then get the new frame
* ask the browser's matrix to -sizeToFit and then get a new frame
* ask for the -matrixInColumn: then get -intercellSpacing and -cellSize
(both were 0)
* ask the browser for the -loadedCellAtColumn:row: then get that cell's
-cellSize
I can't think of anything else. Can it really be this hard to precisely
determine how much space an NSBrowser should take up???
Any thoughts would be appreciated.
--
Nick Kocharhook
_______________________________________________
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.