| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in Mac OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSBrowser.h |
| Related sample code |
This class provides a user interface for displaying and selecting items from a list of data or from hierarchically organized lists of data such as directory paths. Instances of this class are known as browsers. When working with a hierarchy of data, the levels are displayed in columns, which are indexed from left to right.
This class uses the NSBrowserCell class to implement its user interface.
Browsers have the following components:
Columns
Scroll views
Matrices
Browser cells
To the user, browsers display data in columns and rows within each column. These components are arranged in thef following component hierarchy:
Browser |
|---Columns [1..*] |
|---Scroll view |
|---Matrix |
|---Rows [0..*] |
– reusesColumns
– setReusesColumns:
– maxVisibleColumns
– setMaxVisibleColumns:
– autohidesScroller
– setAutohidesScroller:
– backgroundColor
– setBackgroundColor:
– minColumnWidth
– setMinColumnWidth:
– separatesColumns
– setSeparatesColumns:
– takesTitleFromPreviousColumn
– setTakesTitleFromPreviousColumn:
– tile
– delegate
– setDelegate:
– acceptsArrowKeys Deprecated in Mac OS X v10.6
– setAcceptsArrowKeys: Deprecated in Mac OS X v10.6
– allowsBranchSelection
– setAllowsBranchSelection:
– allowsEmptySelection
– setAllowsEmptySelection:
– allowsMultipleSelection
– setAllowsMultipleSelection:
– selectedRowIndexesInColumn:
– selectRowIndexes:inColumn:
– allowsTypeSelect
– setAllowsTypeSelect:
– selectedCell
– selectedCellInColumn:
– selectedCells
– selectAll:
– selectedRowInColumn:
– selectRow:inColumn:
– selectionIndexPath
– setSelectionIndexPath:
– selectionIndexPaths
– setSelectionIndexPaths:
– loadedCellAtRow:column:
– matrixInColumn:
– editItemAtIndexPath:withEvent:select:
– itemAtIndexPath:
– itemAtRow:inColumn:
– indexPathForColumn:
– isLeafItem:
– parentForItemsInColumn:
– addColumn
– columnOfMatrix:
– selectedColumn
– lastColumn
– setLastColumn:
– firstVisibleColumn
– numberOfVisibleColumns
– lastVisibleColumn
– validateVisibleColumns
– isLoaded
– loadColumnZero
– reloadColumn:
– displayAllColumns Deprecated in Mac OS X v10.3
– displayColumn: Deprecated in Mac OS X v10.3
– titleOfColumn:
– setTitle:ofColumn:
– isTitled
– setTitled:
– drawTitleOfColumn:inRect:
– titleHeight
– titleFrameOfColumn:
– hasHorizontalScroller
– setHasHorizontalScroller:
– scrollColumnToVisible:
– scrollColumnsLeftBy:
– scrollColumnsRightBy:
– scrollRowToVisible:inColumn:
– scrollViaScroller: Deprecated in Mac OS X v10.3
– updateScroller Deprecated in Mac OS X v10.3
– draggingSourceOperationMaskForLocal:
– setDraggingSourceOperationMask:forLocal:
– canDragRowsWithIndexes:inColumn:withEvent:
– draggingImageForRowsWithIndexes:inColumn:withEvent:offset:
– namesOfPromisedFilesDroppedAtDestination:
– doubleAction
– setDoubleAction:
– sendsActionOnArrowKeys
– setSendsActionOnArrowKeys:
– sendAction
+ removeSavedColumnsWithAutosaveName:
– columnsAutosaveName
– setColumnsAutosaveName:
– columnContentWidthForColumnWidth:
– columnWidthForColumnContentWidth:
– columnResizingType
– setColumnResizingType:
– prefersAllColumnUserResizing
– setPrefersAllColumnUserResizing:
– widthOfColumn:
– setWidth:ofColumn:
– defaultColumnWidth
– setDefaultColumnWidth:
– rowHeight
– setRowHeight:
Returns the NSBrowserCell class.
+ (Class)cellClass
Always returns the NSBrowserCell class (even if the developer has sent a setCellClass: message to a particular instance).
This method is used by NSControl during initialization and is not meant to be used by applications.
NSBrowser.hRemoves the column configuration data stored under the given name from the application’s user defaults.
+ (void)removeSavedColumnsWithAutosaveName:(NSString *)name
The name of the column configuration data to remove.
NSBrowser.hAdds a column to the right of the last column.
- (void)addColumn
NSBrowser.hIndicates whether the user can select branch items.
- (BOOL)allowsBranchSelection
YES if the user can select branch items when multiple selection is enabled; otherwise, NO.
NSBrowser.hIndicates whether there can be nothing selected.
- (BOOL)allowsEmptySelection
YES if the browser allows the selection to be empty; otherwise, NO.
NSBrowser.hIndicates whether the user can select multiple items.
- (BOOL)allowsMultipleSelection
YES if the browser allows the user to select multiple items at once; otherwise, NO.
NSBrowser.hIndicates whether the browser allows keystroke-based selection (type select).
- (BOOL)allowsTypeSelect
YES (default) when the browser allows keystroke-based selection; otherwise, NO.
NSBrowser.hReturns whether the browser automatically hides its scroller.
- (BOOL)autohidesScroller
YES if the scroller is automatically hidden; otherwise, NO.
NSBrowser.hProvides the browser’s background color.
- (NSColor *)backgroundColor
The browser’s background color.
The default value is [NSColor whiteColor]
NSBrowser.hIndicates whether the browser can attempt to initiate a drag of the given rows for the given event.
- (BOOL)canDragRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)columnIndex withEvent:(NSEvent *)dragEvent
Rows the user is dragging
Column containing the rows the user is dragging.
Mouse-drag event.
YES when rowIndexes identifies at least one row and all the identified rows are enabled; otherwise, NO.
– browser:canDragRowsWithIndexes:inColumn:withEvent: (NSBrowserDelegate)NSBrowser.hReturns the browser’s prototype NSCell.
- (id)cellPrototype
The prototype NSCell. The prototype NSCell instance is copied to display items in the matrices of the browser.
NSBrowser.hReturns the column number of the cell that the user clicked to display a context menu.
- (NSInteger)clickedColumn
The column number of the clicked cell, or -1 if no context menu is active.
NSBrowser.hReturns the row number of the cell that the user clicked to display a context menu.
- (NSInteger)clickedRow
The row number of the clicked cell, or -1 if no context menu is active.
NSBrowser.hReturns the content width for a given column width.
- (CGFloat)columnContentWidthForColumnWidth:(CGFloat)columnWidth
The width of the column. This width is the entire scrolling text view.
The width of the content for the column. This is the width of the matrix in the column.
NSBrowser.hReturns the column number in which the given matrix is located.
- (NSInteger)columnOfMatrix:(NSMatrix *)matrix
The matrix for which to return the column number.
The index of the column in which the specified matrix appears.
NSBrowser.hReturns the browser’s column resizing type.
- (NSBrowserColumnResizingType)columnResizingType
A constant indicating the column resizing type. Possible return values are described in “NSBrowserColumnResizingType”. The default is NSBrowserAutoColumnResizing
NSBrowser.hReturns the name used to automatically save the browser’s column configuration.
- (NSString *)columnsAutosaveName
The name used to save the column configuration.
NSBrowser.hReturns the column width for the width of the given column’s content.
- (CGFloat)columnWidthForColumnContentWidth:(CGFloat)columnContentWidth
The width of the column's content (the width of the the matrix in the column).
The width of the column (the width of the entire scrolling text view).
For example, to guarantee that 16 pixels of your browser cell are always visible, call:
[browser setMinColumnWidth: [browser columnWidthForColumnContentWidth:16]] |
NSBrowser.hReturns the default column width of the browser’s columns.
- (CGFloat)defaultColumnWidth
The default column width.
NSBrowser.hReturns the browser’s delegate.
- (id <NSBrowserDelegate>)delegate
The browser's delegate.
NSBrowser.hResponds to (single) mouse clicks in a column of the browser.
- (void)doClick:(id)sender
NSBrowser.hResponds to double clicks in a column of the browser.
- (void)doDoubleClick:(id)sender
NSBrowser.hReturns the browser’s double-click action method.
- (SEL)doubleAction
The action method invoked when the user double-clicks on the browser.
NSBrowser.hProvides an image to represent dragged rows during a drag operation on the browser.
- (NSImage *)draggingImageForRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)columnIndex withEvent:(NSEvent *)dragEvent offset:(NSPointPointer)dragImageOffset
Rows the user is dragging.
Column with the rows the user is dragging.
Mouse drag event.
Offset for the returned image:
NSZeroPoint: The image is centered under the pointer.
Image representing the visible cells identified by rowIndexes.
– browser:draggingImageForRowsWithIndexes:inColumn:withEvent:offset: (NSBrowserDelegate)NSBrowser.hIndicates the types of dragging operations the source object allows on the dragged image’s data.
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)localDestination
Indicates the location of the dragging operation’s destination object: YES for this application, NO for another application.
NSDragOperationEvery when localDestination is YES.
NSDragOperationNone when localDestination is NO.
This method overrides NSDraggingSource draggingSourceOperationMaskForLocal:.
NSDragging.hDraws the title for the specified column within the given rectangle.
- (void)drawTitleOfColumn:(NSInteger)column inRect:(NSRect)aRect
The index of the column for which to draw the title.
The rectangle within which to draw the title.
NSBrowser.hBegins editing the item at the specified path.
- (void)editItemAtIndexPath:(NSIndexPath *)indexPath withEvent:(NSEvent *)theEvent select:(BOOL)select
The path of the item.
The event to use when beginning the edit.
If YES, the cells contents will be selected; if NO, they will not be selected.
NSBrowser.hReturns the index of the first visible column.
- (NSInteger)firstVisibleColumn
The index of the first visible column.
NSBrowser.hReturns the rectangle containing the given column.
- (NSRect)frameOfColumn:(NSInteger)column
The index of the column for which to retrieve the frame.
The rectangle containing the specified column.
NSBrowser.hReturns the rectangle containing the specified column, not including borders.
- (NSRect)frameOfInsideOfColumn:(NSInteger)column
The index of the column for which to retrieve the inside frame.
The rectangle containing the column, not including the column borders.
NSBrowser.hReturns the frame of the cell at the specified location, including the expandable arrow.
- (NSRect)frameOfRow:(NSInteger)row inColumn:(NSInteger)column
The row of the cell.
The column of the cell.
The frame of the cell, in the NSBrowser coordinate space.
NSBrowser.hGets the row and column coordinates for the specified point, if a cell exists at that point.
- (BOOL)getRow:(NSInteger *)row column:(NSInteger *)column forPoint:(NSPoint)point
On output, the row number of the cell at the specified point, or -1 if there is no cell at the point.
On output, he column number of the cell at the specified point, or -1 if there is no cell at the point.
The point to test.
YES if a cell exists at the specified point; otherwise, NO.
If a row does not exist at point, then -1 is set for the row. If a column does not exist at point, then -1 is set for the column.
NSBrowser.hIndicates whether the browser has a horizontal scroller.
- (BOOL)hasHorizontalScroller
YES if the browser uses an NSScroller object to scroll horizontally; otherwise, NO.
NSBrowser.hReturns the index path of the item whose children are displayed in the given column.
- (NSIndexPath *)indexPathForColumn:(NSInteger)column
The column to find the index path for.
The index path of the column.
This method can only be used if the delegate implements the item data source methods.
NSBrowser.hReturns whether the specified item is a leaf item.
- (BOOL)isLeafItem:(id)item
The item to be checked.
YES if the item is a leaf item; otherwise, NO.
This method may return NO if the item has never been displayed in the browser or accessed via itemAtIndexPath:. Overriding this method has no effect. It may be used only if the browser’s delegate implements the item data source methods.
NSBrowser.hReturns whether column 0 is loaded.
- (BOOL)isLoaded
YES if column 0 is loaded; otherwise, NO.
NSBrowser.hIndicates whether the browser is opaque.
- (BOOL)isOpaque
YES when the browser doesn’t have a title and its background color’s alpha component is 1.0; otherwise, NO.
This method overrides the isOpaque method of NSView.
NSView.hIndicates whether columns display titles.
- (BOOL)isTitled
YES if the columns in a browser display titles; otherwise, NO.
NSBrowser.hReturns the item at the specified index path.
- (id)itemAtIndexPath:(NSIndexPath *)indexPath
The index path of the item to return.
The item.
This method can only be used if the delegate implements the item data source methods. The specified index path must be displayable in the browser.
NSBrowser.hReturns the item located at the specified row and column.
- (id)itemAtRow:(NSInteger)row inColumn:(NSInteger)column
The row of the item.
The column of the item.
The item.
NSBrowser.hReturns the index of the last column loaded.
- (NSInteger)lastColumn
The index of the last loaded column.
NSBrowser.hReturns the index of the last visible column.
- (NSInteger)lastVisibleColumn
The index of the last visible column.
NSBrowser.hLoads column 0; unloads previously loaded columns.
- (void)loadColumnZero
NSBrowser.hLoads, if necessary, and returns the cell at the specified row and column location.
- (id)loadedCellAtRow:(NSInteger)row column:(NSInteger)column
The row index of the cell to return.
The column index of the cell to return.
NSBrowser.hReturns the matrix class used in the browser’s columns.
- (Class)matrixClass
The class of NSMatrix used in the browser's columns.
NSBrowser.hReturns the matrix located in the specified column.
- (NSMatrix *)matrixInColumn:(NSInteger)column
The column index of the matrix to obtain.
The matrix located in the column.
NSBrowser.hReturns the maximum number of visible columns.
- (NSInteger)maxVisibleColumns
The maximum number of visible columns.
NSBrowser.hReturns the minimum column width.
- (CGFloat)minColumnWidth
The minimum column width, in pixels.
NSBrowser.hProvides the names of the files that the browser promises to create at a specified location.
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
Result of sending browser:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:inColumn: to the delegate.
Implementation of NSDraggingSource namesOfPromisedFilesDroppedAtDestination:.
– browser:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:inColumn: (NSBrowserDelegate)NSDragging.hImmediately retiles the browser’s columns using row heights specified by the browser’s delegate.
- (void)noteHeightOfRowsWithIndexesChanged:(NSIndexSet *)indexSet inColumn:(NSInteger)columnIndex
The indexes of the rows to resize.
The column to retile.
The browser’s delegate must implement
NSBrowser.hReturns the number of columns that are visible.
- (NSInteger)numberOfVisibleColumns
The number of visible columns.
NSBrowser.hReturns the item that contains the children located in the specified column.
- (id)parentForItemsInColumn:(NSInteger)column
The column.
The parent item for the specified column.
NSBrowser.hReturns a string representing the browser’s current path.
- (NSString *)path
The path representing the current selection. The components of this path are separated with the string returned by pathSeparator.
Invoking this method is equivalent to invoking pathToColumn: for all columns.
NSBrowser.hReturns the path separator.
- (NSString *)pathSeparator
The path separator. The default is “/”.
NSBrowser.hReturns a string representing the path from the first column up to, but not including, the column at the given index.
- (NSString *)pathToColumn:(NSInteger)column
The index of the column at which the path stops.
The path of the current selection up to, but not including, the specified column. The components of this path are separated with the string returned by pathSeparator.
NSBrowser.hReturns whether the browser is set to resize all columns simultaneously rather than resizing a single column at a time.
- (BOOL)prefersAllColumnUserResizing
YES if the browser is set to resize all columns simultaneously; otherwise, NO. The default is NO.
This setting applies only to browsers that allow the user to resize columns (see the constant NSBrowserUserColumnResizing. Holding down the Option key while resizing switches the type of resizing used.
NSBrowser.hReloads the given column if it exists and sets it to be the last column.
- (void)reloadColumn:(NSInteger)column
The index of the column to reload.
NSBrowser.hUpdates the rows in the column with the specified column index with indexes in the specified set.
- (void)reloadDataForRowIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column
The set of row indexes of the rows to be updated.
The column containing the rows to be updated.
NSBrowser.hIndicates whether the browser reuses matrix objects after their columns are unloaded.
- (BOOL)reusesColumns
YES if NSMatrix objects aren't freed when their columns are unloaded; otherwise, NO.
NSBrowser.hReturns the height of the browser’s rows.
- (CGFloat)rowHeight
The row height.
The default value is 17.0. rowHeight and setRowHeight: are only available when using the item delegate methods. An exception is thrown if you are using the matrix delegate methods.
NSBrowser.hScrolls columns left by the specified number of columns.
- (void)scrollColumnsLeftBy:(NSInteger)shiftAmount
The number of columns by which to scroll the browser.
NSBrowser.hScrolls columns right by the specified number of columns.
- (void)scrollColumnsRightBy:(NSInteger)shiftAmount
The number of columns by which to scroll the browser.
NSBrowser.hScrolls to make the specified column visible.
- (void)scrollColumnToVisible:(NSInteger)column
The index of the column to scroll to.
NSBrowser.hScrolls the specified row to be visible within the specified column.
- (void)scrollRowToVisible:(NSInteger)row inColumn:(NSInteger)column
The index of the row to scroll.
The index of the column containing the row to scroll.
The row’s column will not be scrolled to visible via this method. To scroll the column to visible, use scrollColumnToVisible:.
NSBrowser.hSelects all cells in the last column of the browser.
- (void)selectAll:(id)sender
NSBrowser.hReturns the last (rightmost and lowest) selected cell.
- (id)selectedCell
The selected cell (NSCell).
NSBrowser.hReturns the last (lowest) cell selected in the given column.
- (id)selectedCellInColumn:(NSInteger)column
The column whose last selected cell is to be returned.
The last (or lowest) selected cell.
NSBrowser.hReturns all cells selected in the rightmost column.
- (NSArray *)selectedCells
An array of NSCell objects representing the selected cells in the rightmost browser column.
NSBrowser.hReturns the index of the last column with a selected item.
- (NSInteger)selectedColumn
The index of the last column with a selected item, or -1 if there is no column selected.
NSBrowser.hReturns the row index of the selected cell in the specified column.
- (NSInteger)selectedRowInColumn:(NSInteger)column
The column index specifying the column for which to return the selected row.
The row index of the selected cell in the specified column.
NSBrowser.hProvides the indexes of the selected rows in a given column of the browser.
- (NSIndexSet *)selectedRowIndexesInColumn:(NSInteger)columnIndex
The column whose selected rows are provided.
Rows selected in column columnIndex.
NSBrowser.hReturns the index path of the item selected in the browser.
- (NSIndexPath *)selectionIndexPath
The index path of the selected item, or nil if there is no selection.
NSBrowser.hReturns an array containing the index paths of all items selected in the browser.
- (NSArray *)selectionIndexPaths
The array containing the index paths of the selected items.
NSBrowser.hSelects the cell at the specified row and column index.
- (void)selectRow:(NSInteger)row inColumn:(NSInteger)column
The row index of the cell to select.
The column index of the cell to select.
NSBrowser.hSpecifies the selected rows in a given column of the browser.
- (void)selectRowIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)columnIndex
Rows to be selected in column columnIndex.
Column in which to select rows rowIndexes.
NSBrowser.hSends the action message to the target.
- (BOOL)sendAction
YES if successful; NO if no target for the message could be found.
NSBrowser.hReturns whether pressing an arrow key causes an action message to be sent.
- (BOOL)sendsActionOnArrowKeys
NO if pressing an arrow key scrolls the browser; YES if it also sends the action message specified by setAction:.
NSBrowser.hIndicates whether columns are separated by bezeled borders.
- (BOOL)separatesColumns
YES if the browser's columns are separated by bezeled borders; otherwise, NO.
NSBrowser.hAllows the user to select branch items.
- (void)setAllowsBranchSelection:(BOOL)flag
YES if the user can select branch items when multiple selection is enabled; otherwise, NO.
NSBrowser.hAllows the user to select nothing.
- (void)setAllowsEmptySelection:(BOOL)flag
YES if the browser allows an empty selection; otherwise, NO.
NSBrowser.hAllows the user to select multiple items.
- (void)setAllowsMultipleSelection:(BOOL)flag
YES if the user can select multiple items at once; otherwise, NO.
NSBrowser.hAllows the browser to accept keystroke-based selection.
- (void)setAllowsTypeSelect:(BOOL)allowsTypeSelection
YES to allow type selection; NO to disallow it.
NSBrowser.hAllows the browser to hide its scroller automatically.
- (void)setAutohidesScroller:(BOOL)flag
If YES, the browser hides its scroller automatically; if NO, it does not.
NSBrowser.hSpecifies the browser’s background color.
- (void)setBackgroundColor:(NSColor *)backgroundColor
[NSColor clearColor] specifies a transparent background.
NSBrowser.hSets the class of the cell to be used by the matrices in the columns of the browser.
- (void)setCellClass:(Class)factoryId
The class of NSCell used by the matrices in the columns of the browser. This method creates an instance of the class and calls setCellPrototype:.
NSBrowser.hSets the prototype cell for displaying items in the matrices in the columns of the browser.
- (void)setCellPrototype:(NSCell *)aCell
The prototype NSCell instance.
NSBrowser.hSets the browser’s column resizing type.
- (void)setColumnResizingType:(NSBrowserColumnResizingType)columnResizingType
The column resizing type. Possible values are described in “NSBrowserColumnResizingType”. The default is NSBrowserAutoColumnResizing. This setting is persistent.
NSBrowser.hSets the name used to automatically save the browser’s column configuration.
- (void)setColumnsAutosaveName:(NSString *)name
The name used to save the column configuration. If name is different from the current name, this method also reads in any column configuration data previously saved under name and applies the values to the browser.
Column configuration is defined as an array of column content widths. One width is saved for each level the user has reached. That is, the browser saves column width based on depth, not on unique paths. To do more complex column persistence, you should register for NSBrowserColumnConfigurationDidChangeNotification and handle persistence yourself. This setting is persistent.
NSBrowser.hSets the default column width for new browser columns that do not otherwise have an initial width from defaults or the browser’s delegate.
- (void)setDefaultColumnWidth:(CGFloat)columnWidth
The default column width to set.
NSBrowser.hSets the browser’s delegate.
- (void)setDelegate:(id <NSBrowserDelegate>)anObject
The object to set at the browser's delegate.
NSBrowser.hSets the browser’s double-click action.
- (void)setDoubleAction:(SEL)aSelector
The action method to invoke when the browser is double-clicked.
For the method to have any effect, the browser’s action and target must be set to the class in which the selector is declared. See Action Messages for additional information on action messages.
NSBrowser.hSpecifies the drag-operation mask for dragging operations with local or external destinations.
- (void)setDraggingSourceOperationMask:(NSDragOperation)dragOperationMask forLocal:(BOOL)localDestination
Dragging operation mask to use for either local or external drag operations, as specified by localDestination.
Indicates the location of the dragging operation’s destination object:
YES for this application; NO for another application.
NSBrowser.hSets whether the browser has a scroller to scroll horizontally.
- (void)setHasHorizontalScroller:(BOOL)flag
YES if the browser uses an NSScroller object to scroll horizontally; otherwise, NO.
NSBrowser.hSets the last column.
- (void)setLastColumn:(NSInteger)column
The index of the last column.
NSBrowser.hSets the matrix class to be used in the browser’s columns.
- (void)setMatrixClass:(Class)factoryId
The matrix class (NSMatrix or an NSMatrix subclass) used in the browser's columns.
NSBrowser.hSets the maximum number of columns that can be displayed.
- (void)setMaxVisibleColumns:(NSInteger)columnCount
The maximum number of visible columns.
NSBrowser.hSets the minimum column width.
- (void)setMinColumnWidth:(CGFloat)columnWidth
The minimum column width, in pixels.
NSBrowser.hSets the path to be displayed by the browser.
- (BOOL)setPath:(NSString *)path
The path to display. If path is prefixed by the path separator, the path is absolute, containing the full path from the browser’s first column. Otherwise, the path is relative, extending the browser’s current path starting at the last column.
YES if the given path is valid; otherwise, NO.
While parsing path, the browser compares each component with the entries in the current column. If an exact match is found, the matching entry is selected, and the next component is compared to the next column’s entries. If no match is found for a component, the method exits and returns NO; the final path is set to the valid portion of path. If each component of path specifies a valid branch or leaf in the browser’s hierarchy, the method returns YES.
NSBrowser.hSets the path separator.
- (void)setPathSeparator:(NSString *)newString
The new path separator.
NSBrowser.hCauses the browser to resize all column simultaneously rather than resize a single column at a time.
- (void)setPrefersAllColumnUserResizing:(BOOL)prefersAllColumnResizing
YES to cause the browser to resize all columns simultaneously; the default is single column resizing (NO). This setting applies only to browsers that allow the user to resize columns (see NSBrowserUserColumnResizing. Holding down the Option key while resizing switches the type of resizing used. This setting is persistent.
NSBrowser.hSpecifies whether matrices can be reused.
- (void)setReusesColumns:(BOOL)flag
YES to prevent NSMatrix objects from being freed when their columns are unloaded, so they can be reused; otherwise, NO.
NSBrowser.hSets the height of the browser’s rows to the specified value.
- (void)setRowHeight:(CGFloat)height
The new height to set.
The value must be greater than 0. Any fractional value will be forced to an integral value for drawing. For variable row height browsers (ones whose delegates implement browser:heightOfRow:inColumn:), the row height will be used to draw alternating rows past the last row in each browser column. rowHeight and setRowHeight: are only available when using the item delegate methods. An exception is thrown if you are using the matrix delegate methods.
NSBrowser.hSets the browser’s selection to the item with the specified path.
- (void)setSelectionIndexPath:(NSIndexPath *)path
The path of the item to select.
NSBrowser.hSets the browser’s selection to the items whose index paths are in the specified array.
- (void)setSelectionIndexPaths:(NSArray *)paths
The array containing the index paths of the items to select.
NSBrowser.hAllows the specified action message to be sent when the user presses an arrow key.
- (void)setSendsActionOnArrowKeys:(BOOL)flag
YES if pressing an arrow key should send the action message specified by setAction: in addition to scrolling the browser; NO if it should only scroll the browser.
NSBrowser.hSeparates columns with bezeled borders.
- (void)setSeparatesColumns:(BOOL)flag
YES if the browser's columns should be separated by bezeled borders; otherwise, NO. This value is ignored if isTitled does not return NO.
NSBrowser.hSets whether the title of a column is set to the string value of the selected cell in the previous column.
- (void)setTakesTitleFromPreviousColumn:(BOOL)flag
YES if the title of a column should be set to the string value of the selected NSCell in the previous column; otherwise, NO.
NSBrowser.hSets the title of the given column.
- (void)setTitle:(NSString *)aString ofColumn:(NSInteger)column
The title of the column.
The index of the column whose title should be set.
NSBrowser.hSets columns to display titles.
- (void)setTitled:(BOOL)flag
YES if the columns in a browser display titles; otherwise, NO.
NSBrowser.hSets the width of the specified column.
- (void)setWidth:(CGFloat)columnWidth ofColumn:(NSInteger)columnIndex
The new width of the specified column.
The index of the column for which to set the width.
This method can be used to set the initial width of browser columns unless the column sizing is automatic; setWidth:ofColumn: does nothing if columnResizingType is NSBrowserAutoColumnResizing. To set the default width for new columns (that don’t otherwise have initial widths from defaults or via the delegate), use a columnIndex of –1. A value set for columnIndex of –1 is persistent. An NSBrowserColumnConfigurationDidChangeNotification notification is posted (not immediately), if necessary, so that the browser can autosave the new column configuration.
– widthOfColumn:– browser:shouldSizeColumn:forUserResize:toWidth: (NSBrowserDelegate)NSBrowser.hIndicates whether a column takes its title from the selected cell in the previous column.
- (BOOL)takesTitleFromPreviousColumn
YES if the title of a column is set to the string value of the selected NSCell in the previous column; otherwise, NO.
NSBrowser.hAdjusts the various subviews of the browser—scrollers, columns, titles, and so on—without redrawing.
- (void)tile
Your code shouldn’t send this message. It’s invoked any time the appearance of the browser changes.
NSBrowser.hReturns the bounds of the title frame for the specified column.
- (NSRect)titleFrameOfColumn:(NSInteger)column
The index of the column for which to return the title frame.
The rectangle specifying the bounds of the column's title frame.
NSBrowser.hReturns the height of the column titles.
- (CGFloat)titleHeight
The height of the column titles for the browser.
NSBrowser.hReturns the title displayed for the given column.
- (NSString *)titleOfColumn:(NSInteger)column
The index of the column for which to get the title.
The title of the specified column.
NSBrowser.hValidates the browser’s visible columns.
- (void)validateVisibleColumns
This method invokes the delegate method browser:isColumnValid:
NSBrowser.hReturns the width of the specified column.
- (CGFloat)widthOfColumn:(NSInteger)column
The index of the column for which to retrieve the width.
The width of the column.
NSBrowser.hTypes of browser column resizing.
enum {
NSBrowserNoColumnResizing = 0,
NSBrowserAutoColumnResizing = 1,
NSBrowserUserColumnResizing = 2
};
typedef NSUInteger NSBrowserColumnResizingType;
NSBrowserNoColumnResizingNeither NSBrowser nor the user can change the column width. The developer must explicitly set all column widths.
Available in Mac OS X v10.3 and later.
Declared in NSBrowser.h.
NSBrowserAutoColumnResizingAll columns have the same width, calculated using a combination of the minimum column width and maximum number of visible columns settings. The column width changes as the window size changes. The user cannot resize columns.
Available in Mac OS X v10.3 and later.
Declared in NSBrowser.h.
NSBrowserUserColumnResizingThe developer chooses the initial column widths, but users can resize all columns simultaneously or each column individually.
Available in Mac OS X v10.3 and later.
Declared in NSBrowser.h.
These constants are used by the setColumnResizingType: and columnResizingType methods.
The type used to specify the drop type of a drag-and-drop operation. See browser:validateDrop:proposedRow:column:dropOperation: for more information.
enum {
NSBrowserDropOn,
NSBrowserDropAbove
};
typedef NSUInteger NSBrowserDropOperation;
NSBrowserDropOnThe drop occurs at the row to which the item was dragged.
Available in Mac OS X v10.5 and later.
Declared in NSBrowser.h.
NSBrowserDropAboveThe drop occurs above the row to which the item was dragged.
Available in Mac OS X v10.5 and later.
Declared in NSBrowser.h.
NSBrowser.hThe version of the AppKit.framework containing a specific bug fix or capability.
#define NSAppKitVersionNumberWithContinuousScrollingBrowser 680.0 #define NSAppKitVersionNumberWithColumnResizingBrowser 685.0
NSAppKitVersionNumberWithContinuousScrollingBrowserThe specific version of the AppKit framework that introduced support the continuous scrolling in NSBrowser. Developers should not need to use this constant unless they are writing applications for Mac OS X v10.3 and earlier.
Available in Mac OS X v10.3 and later.
Declared in NSBrowser.h.
NSAppKitVersionNumberWithColumnResizingBrowserThe specific version of the AppKit framework that introduced support for resizing individual browser columns. Developers should not need to use this constant unless they are writing applications for Mac OS X v10.3 and earlier.
Available in Mac OS X v10.3 and later.
Declared in NSBrowser.h.
Notifies the delegate when the width of a browser column has changed. The notification object is the browser whose column sizes need to be made persistent. This notification does not contain a userInfo dictionary. If the user resizes more than one column, a single notification is posted when the user is finished resizing.
NSBrowser.hLast updated: 2009-08-28