# NSBrowser

scottc@net-community.com
far@ix.netcom.com
wolff@cybercable.fr
mirko.viviani@rccr.cremona.it
FredKiefer@gmx.de

Control to display and select from hierarchal lists

1996, 1997, 2002 Free Software Foundation, Inc.
Software documentation for the NSBrowser class
AppKit/NSBrowser.h
NSCoding
Description forthcoming.
cellClass
Returns the NSBrowserCell class (regardless of whether a setCellClass: message has been sent to a particular instance). This method is not meant to be used by applications.
acceptsArrowKeys
Returns `YES` if the arrow keys are enabled.
addColumn
Adds a column to the right of the last column.
allowsBranchSelection
Returns whether the user can select branch items when multiple selection is enabled.
allowsEmptySelection
Returns whether there can be nothing selected.
allowsMultipleSelection
Returns whether the user can select multiple items.
cellPrototype
Returns the NSBrowser's prototype NSCell instance.
columnOfMatrix:
matrix
Returns the column number in which matrix is located.
delegate
Returns the NSBrowser's delegate.
displayAllColumns
Updates the NSBrowser to display all loaded columns.
displayColumn:
column
Updates the NSBrowser to display the column with the given index.
doClick:
sender
Responds to (single) mouse clicks in a column of the NSBrowser.
doDoubleClick:
sender
Responds to double-clicks in a column of the NSBrowser.
doubleAction
Returns the NSBrowser's double-click action method.
drawTitle:
title
inRect:
aRect
ofColumn:
column
Draws the title for the column at index column within the rectangle defined by aRect.
drawTitleOfColumn:
column
inRect:
aRect
Description forthcoming.
firstVisibleColumn
Returns the index of the first visible column.
frameOfColumn:
column
Returns the rectangle containing the column at index column.
frameOfInsideOfColumn:
column
Returns the rectangle containing the column at index column,
hasHorizontalScroller
Returns whether an NSScroller is used to scroll horizontally.
isLoaded
Returns whether column zero is loaded.
isTitled
Returns whether columns display titles.
lastColumn
Returns the index of the last column loaded.
lastVisibleColumn
Returns the index of the last visible column.
loadColumnZero
Loads column zero; unloads previously loaded columns.
loadedCellAtRow:
row
column:
column
Loads if necessary and returns the NSCell at row in column.
matrixClass
Returns the class of NSMatrix used in the NSBrowser's columns.
matrixInColumn:
column
Returns the matrix located in the column identified by index column.
maxVisibleColumns
Returns the maximum number of visible columns.
minColumnWidth
Returns the minimum column width in pixels.
numberOfVisibleColumns
Returns the number of columns visible.
path
Returns the browser's current path.
pathSeparator
Returns the path separator. The default is "/".
pathToColumn:
column
Returns a string representing the path from the first column up to, but not including, the column at index column.
reloadColumn:
column
Reloads column if it is loaded; sets it as the last column. Reselects previously selected cells, if they remain.
reusesColumns
Returns `YES` if NSMatrix objects aren't freed when their columns are unloaded.
scrollColumnToVisible:
column
Scrolls to make the column at index column visible.
scrollColumnsLeftBy:
shiftAmount
Scrolls columns left by shiftAmount columns.
scrollColumnsRightBy:
shiftAmount
Scrolls columns right by shiftAmount columns.
scrollViaScroller:
sender
Scrolls columns left or right based on an NSScroller.
selectAll:
sender
Selects all NSCells in the last column of the NSBrowser.
selectRow:
row
inColumn:
column
Selects the cell at index row in the column identified by index column.
selectedCell
Returns the last (rightmost and lowest) selected NSCell.
selectedCellInColumn:
column
Returns the last (lowest) NSCell that's selected in column.
selectedCells
Returns all cells selected in the rightmost column.
selectedColumn
Returns the index of the last column with a selected item.
selectedRowInColumn:
column
Returns the row index of the selected cell in the column specified by index column.
sendAction
Sends the action message to the target. Returns `YES` upon success, `NO` if no target for the message could be found.
sendsActionOnArrowKeys
Returns `NO` if pressing an arrow key only scrolls the browser, `YES` if it also sends the action message specified by setAction:.
separatesColumns
Returns whether columns are separated by bezeled borders.
setAcceptsArrowKeys:
flag
Enables or disables the arrow keys as used for navigating within and between browsers.
setAllowsBranchSelection:
flag
Sets whether the user can select branch items when multiple selection is enabled.
setAllowsEmptySelection:
flag
Sets whether there can be nothing selected.
setAllowsMultipleSelection:
flag
Sets whether the user can select multiple items.
setCellClass:
classId
Sets the class of NSCell used in the columns of the NSBrowser.
setCellPrototype:
aCell
Sets the NSCell instance copied to display items in the columns of NSBrowser.
setDelegate:
anObject
Sets the delegate of the receiver. If not `nil`, the delegate must either be passive and respond to [NSObject -browser:numberOfRowsInColumn:] or be active and respond to [NSObject -browser:createRowsForColumn:inMatrix:] but not both. If the delegate is active it must also respond to [NSObject -browser:willDisplayCell:atRow:column:]. If the delegate is not `nil` but does not meet these conditions, an NSBrowserIllegalDelegateException will be raised.
setDoubleAction:
aSelector
Sets the NSBrowser's double-click action to aSelector.
setHasHorizontalScroller:
flag
Sets whether an NSScroller is used to scroll horizontally.
setLastColumn:
column
Sets the last column to column.
setMatrixClass:
classId
Sets the matrix class (NSMatrix or an NSMatrix subclass) used in the NSBrowser's columns.
setMaxVisibleColumns:
columnCount
Sets the maximum number of columns displayed.
setMinColumnWidth:
columnWidth
Sets the minimum column width in pixels.
setPath:
path

Parses path and selects corresponding items in the NSBrowser columns.

This is the primary mechanism for programmatically updating the selection of a browser. It should result in the browser cells corresponding to the components being selected, and the browser columns up to the end of path (and just beyond if the last selected cell's [NSBrowserCell -isLeaf] returns `YES`).
It does not result in the browsers action being sent to its target, just in a change to the browser selection and display.

If path begins with the -pathSeparator then it is taken to be absolute and the first component in it is expected to denote a cell in column zero. Otherwise it is taken to be relative to the currently selected column.

Empty components (ie where a -pathSeparator occurs immediately after another or at the end of path) are simply ignored.

The receivers delegate is asked to select each cell in turn using the -browser:selectCellWithString:inColumn: method (if it implements it). If this call to the delegate returns `NO` then the attempt to set the path fails.
If the delegate does not implement the method, the browser attempts to locate and select the cell itsself, and the method fails if it is unable to locate the cell by matching its [NSCell -stringValue] with the component of the path.

The method returns `YES` if path contains no components or if a cell corresponding to the path was found. Otherwise it returns `NO`.

setPathSeparator:
aString
Sets the path separator to newString.
setReusesColumns:
flag
If flag is `YES`, prevents NSMatrix objects from being freed when their columns are unloaded, so they can be reused.
setSendsActionOnArrowKeys:
flag
Sets whether pressing an arrow key will cause the action message to be sent (in addition to causing scrolling).
setSeparatesColumns:
flag
Sets whether to separate columns with bezeled borders.
setTakesTitleFromPreviousColumn:
flag
Sets whether the title of a column is set to the string value of the selected NSCell in the previous column.
setTitle:
aString
ofColumn:
column
Sets the title of the column at index column to aString.
setTitled:
flag
Sets whether columns display titles.
takesTitleFromPreviousColumn
Returns `YES` if the title of a column is set to the string value of the selected NSCell in the previous column.
tile
Adjusts the various subviews of NSBrowser-scrollers, columns, titles, and so on-without redrawing. Your code shouldn't send this message. It's invoked any time the appearance of the NSBrowser changes.
titleFrameOfColumn:
column
Returns the bounds of the title frame for the column at index column.
titleHeight
Returns the height of column titles.
titleOfColumn:
column
Returns the title displayed for the column at index column.
updateScroller
Updates the horizontal scroller to reflect column positions.
validateVisibleColumns
Invokes delegate method browser:isColumnValid: for visible columns.
Software documentation for the NSBrowser(GNUstepExtensions) category
AppKit/NSBrowser.h
Description forthcoming.
acceptsAlphaNumericalKeys
Returns `YES` if the alphanumerical keys are enabled.
sendsActionOnAlphaNumericalKeys
Returns `NO` if pressing an arrow key only scrolls the browser, `YES` if it also sends the action message specified by setAction:.
setAcceptsAlphaNumericalKeys:
flag
Enables or disables the arrow keys as used for navigating within and between browsers.
setSendsActionOnAlphaNumericalKeys:
flag
Sets whether pressing an arrow key will cause the action message to be sent (in addition to causing scrolling).
Software documentation for the NSObject(NSBrowserDelegate) informal protocol
AppKit/NSBrowser.h
Description forthcoming.
browser:
sender
createRowsForColumn:
column
inMatrix:
matrix
Description forthcoming.
browser:
sender
isColumnValid:
column
Description forthcoming.
browser:
sender
numberOfRowsInColumn:
column
Description forthcoming.
browser:
sender
selectCellWithString:
title
inColumn:
column
Description forthcoming.
browser:
sender
selectRow:
row
inColumn:
column
Description forthcoming.
browser:
sender
titleOfColumn:
column
Description forthcoming.
browser:
sender
willDisplayCell:
cell
atRow:
row
column:
column
Description forthcoming.
browserDidScroll:
sender
Description forthcoming.
browserWillScroll:
sender
Description forthcoming.