NSBrowser Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSBrowser.h |
Overview
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 the following component hierarchy:
Browser |
|---Columns [1..*] |
|---Scroll view |
|---Matrix |
|---Rows [0..*] |
Tasks
Configuring Browsers
-
– reusesColumns -
– setReusesColumns: -
– maxVisibleColumns -
– setMaxVisibleColumns: -
– autohidesScroller -
– setAutohidesScroller: -
– backgroundColor -
– setBackgroundColor: -
– minColumnWidth -
– setMinColumnWidth: -
– separatesColumns -
– setSeparatesColumns: -
– takesTitleFromPreviousColumn -
– setTakesTitleFromPreviousColumn: -
– tile -
– delegate -
– setDelegate: -
– acceptsArrowKeysDeprecated in OS X v10.6 -
– setAcceptsArrowKeys:Deprecated in OS X v10.6
Getting Browser Information
Managing Component Types
Managing Selection Behavior
-
– allowsBranchSelection -
– setAllowsBranchSelection: -
– allowsEmptySelection -
– setAllowsEmptySelection: -
– allowsMultipleSelection -
– setAllowsMultipleSelection: -
– selectedRowIndexesInColumn: -
– selectRowIndexes:inColumn: -
– allowsTypeSelect -
– setAllowsTypeSelect:
Managing Selection
-
– selectedCell -
– selectedCellInColumn: -
– selectedCells -
– selectAll: -
– selectedRowInColumn: -
– selectRow:inColumn: -
– selectionIndexPath -
– setSelectionIndexPath: -
– selectionIndexPaths -
– setSelectionIndexPaths:
Accessing Components
-
– loadedCellAtRow:column: -
– matrixInColumn: -
– editItemAtIndexPath:withEvent:select: -
– itemAtIndexPath: -
– itemAtRow:inColumn: -
– indexPathForColumn: -
– isLeafItem: -
– parentForItemsInColumn:
Managing the Path
Managing Columns
-
– addColumn -
– columnOfMatrix: -
– selectedColumn -
– lastColumn -
– setLastColumn: -
– firstVisibleColumn -
– numberOfVisibleColumns -
– lastVisibleColumn -
– validateVisibleColumns -
– isLoaded -
– loadColumnZero -
– reloadColumn: -
– displayAllColumnsDeprecated in OS X v10.3 -
– displayColumn:Deprecated in OS X v10.3
Accessing Column Titles
-
– titleOfColumn: -
– setTitle:ofColumn: -
– isTitled -
– setTitled: -
– drawTitleOfColumn:inRect: -
– titleHeight -
– titleFrameOfColumn:
Updating Browsers
Scrolling
-
– hasHorizontalScroller -
– setHasHorizontalScroller: -
– scrollColumnToVisible: -
– scrollColumnsLeftBy: -
– scrollColumnsRightBy: -
– scrollRowToVisible:inColumn: -
– scrollViaScroller:Deprecated in OS X v10.3 -
– updateScrollerDeprecated in OS X v10.3
Dragging
-
– draggingSourceOperationMaskForLocal: -
– setDraggingSourceOperationMask:forLocal: -
– canDragRowsWithIndexes:inColumn:withEvent: -
– draggingImageForRowsWithIndexes:inColumn:withEvent:offset: -
– namesOfPromisedFilesDroppedAtDestination:
Getting Column Frames
Getting Row Frames
Managing Actions
-
– doubleAction -
– setDoubleAction: -
– sendsActionOnArrowKeys -
– setSendsActionOnArrowKeys: -
– sendAction
Handling Mouse-Click Events
Sizing
-
+ removeSavedColumnsWithAutosaveName: -
– columnsAutosaveName -
– setColumnsAutosaveName: -
– columnContentWidthForColumnWidth: -
– columnWidthForColumnContentWidth: -
– columnResizingType -
– setColumnResizingType: -
– prefersAllColumnUserResizing -
– setPrefersAllColumnUserResizing: -
– widthOfColumn: -
– setWidth:ofColumn: -
– defaultColumnWidth -
– setDefaultColumnWidth: -
– rowHeight -
– setRowHeight:
Class Methods
cellClass
Returns the NSBrowserCell class.
Return Value
Always returns the NSBrowserCell class (even if the developer has sent a setCellClass: message to a particular instance).
Discussion
This method is used by NSControl during initialization and is not meant to be used by applications.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hremoveSavedColumnsWithAutosaveName:
Removes the column configuration data stored under the given name from the application’s user defaults.
Parameters
- name
The name of the column configuration data to remove.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSBrowser.hInstance Methods
addColumn
Adds a column to the right of the last column.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hallowsBranchSelection
Indicates whether the user can select branch items.
Return Value
YES if the user can select branch items when multiple selection is enabled; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hallowsEmptySelection
Indicates whether there can be nothing selected.
Return Value
YES if the browser allows the selection to be empty; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hallowsMultipleSelection
Indicates whether the user can select multiple items.
Return Value
YES if the browser allows the user to select multiple items at once; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hallowsTypeSelect
Indicates whether the browser allows keystroke-based selection (type select).
Return Value
YES (default) when the browser allows keystroke-based selection; otherwise, NO.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSBrowser.hautohidesScroller
Returns whether the browser automatically hides its scroller.
Return Value
YES if the scroller is automatically hidden; otherwise, NO.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hbackgroundColor
Provides the browser’s background color.
Return Value
The browser’s background color.
Discussion
The default value is [NSColor whiteColor]
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSBrowser.hcanDragRowsWithIndexes:inColumn:withEvent:
Indicates whether the browser can attempt to initiate a drag of the given rows for the given event.
Parameters
- rowIndexes
Rows the user is dragging
- columnIndex
Column containing the rows the user is dragging.
- dragEvent
Mouse-drag event.
Return Value
YES when rowIndexes identifies at least one row and all the identified rows are enabled; otherwise, NO.
Availability
- Available in OS X v10.5 and later.
See Also
-
browser:canDragRowsWithIndexes:inColumn:withEvent:(NSBrowserDelegate)
Declared In
NSBrowser.hcellPrototype
Returns the browser’s prototype NSCell.
Return Value
The prototype NSCell. The prototype NSCell instance is copied to display items in the matrices of the browser.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hclickedColumn
Returns the column number of the cell that the user clicked to display a context menu.
Return Value
The column number of the clicked cell, or -1 if no context menu is active.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hclickedRow
Returns the row number of the cell that the user clicked to display a context menu.
Return Value
The row number of the clicked cell, or -1 if no context menu is active.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hcolumnContentWidthForColumnWidth:
Returns the content width for a given column width.
Parameters
- columnWidth
The width of the column. This width is the entire scrolling text view.
Return Value
The width of the content for the column. This is the width of the matrix in the column.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSBrowser.hcolumnOfMatrix:
Returns the column number in which the given matrix is located.
Parameters
- matrix
The matrix for which to return the column number.
Return Value
The index of the column in which the specified matrix appears.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hcolumnResizingType
Returns the browser’s column resizing type.
Return Value
A constant indicating the column resizing type. Possible return values are described in “NSBrowserColumnResizingType”. The default is NSBrowserAutoColumnResizing
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSBrowser.hcolumnsAutosaveName
Returns the name used to automatically save the browser’s column configuration.
Return Value
The name used to save the column configuration.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSBrowser.hcolumnWidthForColumnContentWidth:
Returns the column width for the width of the given column’s content.
Parameters
- columnContentWidth
The width of the column's content (the width of the the matrix in the column).
Return Value
The width of the column (the width of the entire scrolling text view).
Discussion
For example, to guarantee that 16 pixels of your browser cell are always visible, call:
[browser setMinColumnWidth: [browser columnWidthForColumnContentWidth:16]] |
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSBrowser.hdefaultColumnWidth
Returns the default column width of the browser’s columns.
Return Value
The default column width.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hdelegate
Returns the browser’s delegate.
Return Value
The browser's delegate.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hdoClick:
Responds to (single) mouse clicks in a column of the browser.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hdoDoubleClick:
Responds to double clicks in a column of the browser.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hdoubleAction
Returns the browser’s double-click action method.
Return Value
The action method invoked when the user double-clicks on the browser.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hdraggingImageForRowsWithIndexes:inColumn:withEvent:offset:
Provides an image to represent dragged rows during a drag operation on the browser.
Parameters
- rowIndexes
Rows the user is dragging.
- columnIndex
Column with the rows the user is dragging.
- dragEvent
Mouse drag event.
- dragImageOffset
Offset for the returned image:
NSZeroPoint: The image is centered under the pointer.
Return Value
Image representing the visible cells identified by rowIndexes.
Availability
- Available in OS X v10.5 and later.
See Also
-
browser:draggingImageForRowsWithIndexes:inColumn:withEvent:offset:(NSBrowserDelegate)
Declared In
NSBrowser.hdraggingSourceOperationMaskForLocal:
Indicates the types of dragging operations the source object allows on the dragged image’s data.
Parameters
- localDestination
Indicates the location of the dragging operation’s destination object:
YESfor this application,NOfor another application.
Return Value
NSDragOperationEverywhen localDestination isYES.NSDragOperationNonewhen localDestination isNO.
Discussion
Implementation of the NSDraggingSource method draggingSourceOperationMaskForLocal:.
Availability
- Available in OS X v10.0 and later.
drawTitleOfColumn:inRect:
Draws the title for the specified column within the given rectangle.
Parameters
- column
The index of the column for which to draw the title.
- aRect
The rectangle within which to draw the title.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.heditItemAtIndexPath:withEvent:select:
Begins editing the item at the specified path.
Parameters
- indexPath
The path of the item.
- theEvent
The event to use when beginning the edit.
- select
If
YES, the cells contents will be selected; ifNO, they will not be selected.
Availability
- Available in OS X v10.6 and later.
Declared In
NSBrowser.hfirstVisibleColumn
Returns the index of the first visible column.
Return Value
The index of the first visible column.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hframeOfColumn:
Returns the rectangle containing the given column.
Parameters
- column
The index of the column for which to retrieve the frame.
Return Value
The rectangle containing the specified column.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.hframeOfInsideOfColumn:
Returns the rectangle containing the specified column, not including borders.
Parameters
- column
The index of the column for which to retrieve the inside frame.
Return Value
The rectangle containing the column, not including the column borders.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.hframeOfRow:inColumn:
Returns the frame of the cell at the specified location, including the expandable arrow.
Parameters
- row
The row of the cell.
- column
The column of the cell.
Return Value
The frame of the cell, in the NSBrowser coordinate space.
Availability
- Available in OS X v10.6 and later.
Declared In
NSBrowser.hgetRow:column:forPoint:
Gets the row and column coordinates for the specified point, if a cell exists at that point.
Parameters
- row
On output, the row number of the cell at the specified point, or
-1if there is no cell at the point.- column
On output, he column number of the cell at the specified point, or
-1if there is no cell at the point.- point
The point to test.
Return Value
YES if a cell exists at the specified point; otherwise, NO.
Discussion
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.
Availability
- Available in OS X v10.6 and later.
Declared In
NSBrowser.hhasHorizontalScroller
Indicates whether the browser has a horizontal scroller.
Return Value
YES if the browser uses an NSScroller object to scroll horizontally; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hindexPathForColumn:
Returns the index path of the item whose children are displayed in the given column.
Parameters
- column
The column to find the index path for.
Return Value
The index path of the column.
Discussion
This method can only be used if the delegate implements the item data source methods.
Availability
- Available in OS X v10.6 and later.
Declared In
NSBrowser.hisLeafItem:
Returns whether the specified item is a leaf item.
Parameters
- item
The item to be checked.
Return Value
YES if the item is a leaf item; otherwise, NO.
Discussion
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.
Availability
- Available in OS X v10.6 and later.
Declared In
NSBrowser.hisLoaded
Returns whether column 0 is loaded.
Return Value
YES if column 0 is loaded; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hisOpaque
Indicates whether the browser is opaque.
Return Value
YES when the browser doesn’t have a title and its background color’s alpha component is 1.0; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
Declared In
NSView.hisTitled
Indicates whether columns display titles.
Return Value
YES if the columns in a browser display titles; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hitemAtIndexPath:
Returns the item at the specified index path.
Parameters
- indexPath
The index path of the item to return.
Return Value
The item.
Discussion
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.
Availability
- Available in OS X v10.6 and later.
Declared In
NSBrowser.hitemAtRow:inColumn:
Returns the item located at the specified row and column.
Parameters
- row
The row of the item.
- column
The column of the item.
Return Value
The item.
Availability
- Available in OS X v10.6 and later.
Declared In
NSBrowser.hlastColumn
Returns the index of the last column loaded.
Return Value
The index of the last loaded column.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hlastVisibleColumn
Returns the index of the last visible column.
Return Value
The index of the last visible column.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hloadColumnZero
Loads column 0; unloads previously loaded columns.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hloadedCellAtRow:column:
Loads, if necessary, and returns the cell at the specified row and column location.
Parameters
- row
The row index of the cell to return.
- column
The column index of the cell to return.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.hmatrixClass
Returns the matrix class used in the browser’s columns.
Return Value
The class of NSMatrix used in the browser's columns.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hmatrixInColumn:
Returns the matrix located in the specified column.
Parameters
- column
The column index of the matrix to obtain.
Return Value
The matrix located in the column.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hmaxVisibleColumns
Returns the maximum number of visible columns.
Return Value
The maximum number of visible columns.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hminColumnWidth
Returns the minimum column width.
Return Value
The minimum column width, in pixels.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hnamesOfPromisedFilesDroppedAtDestination:
Provides the names of the files that the browser promises to create at a specified location.
Return Value
Result of sending browser:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:inColumn: to the delegate.
Discussion
Implementation of the NSDraggingSource method namesOfPromisedFilesDroppedAtDestination:.
Availability
- Available in OS X v10.2 and later.
See Also
noteHeightOfRowsWithIndexesChanged:inColumn:
Immediately retiles the browser’s columns using row heights specified by the browser’s delegate.
Parameters
- indexSet
The indexes of the rows to resize.
- columnIndex
The column to retile.
Discussion
The browser’s delegate must implement
Availability
- Available in OS X v10.6 and later.
Declared In
NSBrowser.hnumberOfVisibleColumns
Returns the number of columns that are visible.
Return Value
The number of visible columns.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hparentForItemsInColumn:
Returns the item that contains the children located in the specified column.
Parameters
- column
The column.
Return Value
The parent item for the specified column.
Availability
- Available in OS X v10.6 and later.
Declared In
NSBrowser.hpath
Returns a string representing the browser’s current path.
Return Value
The path representing the current selection. The components of this path are separated with the string returned by pathSeparator.
Discussion
Invoking this method is equivalent to invoking pathToColumn: for all columns.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hpathSeparator
Returns the path separator.
Return Value
The path separator. The default is “/”.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hpathToColumn:
Returns a string representing the path from the first column up to, but not including, the column at the given index.
Parameters
- column
The index of the column at which the path stops.
Return Value
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.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hprefersAllColumnUserResizing
Returns whether the browser is set to resize all columns simultaneously rather than resizing a single column at a time.
Return Value
YES if the browser is set to resize all columns simultaneously; otherwise, NO. The default is NO.
Discussion
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.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSBrowser.hreloadColumn:
Reloads the given column if it exists and sets it to be the last column.
Parameters
- column
The index of the column to reload.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hreloadDataForRowIndexes:inColumn:
Updates the rows in the column with the specified column index with indexes in the specified set.
Parameters
- rowIndexes
The set of row indexes of the rows to be updated.
- column
The column containing the rows to be updated.
Availability
- Available in OS X v10.6 and later.
Declared In
NSBrowser.hreusesColumns
Indicates whether the browser reuses matrix objects after their columns are unloaded.
Return Value
YES if NSMatrix objects aren't freed when their columns are unloaded; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hrowHeight
Returns the height of the browser’s rows.
Return Value
The row height.
Discussion
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.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hscrollColumnsLeftBy:
Scrolls columns left by the specified number of columns.
Parameters
- shiftAmount
The number of columns by which to scroll the browser.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.hscrollColumnsRightBy:
Scrolls columns right by the specified number of columns.
Parameters
- shiftAmount
The number of columns by which to scroll the browser.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.hscrollColumnToVisible:
Scrolls to make the specified column visible.
Parameters
- column
The index of the column to scroll to.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hscrollRowToVisible:inColumn:
Scrolls the specified row to be visible within the specified column.
Parameters
- row
The index of the row to scroll.
- column
The index of the column containing the row to scroll.
Discussion
The row’s column will not be scrolled to visible via this method. To scroll the column to visible, use scrollColumnToVisible:.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hselectAll:
Selects all cells in the last column of the browser.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.hselectedCell
Returns the last (rightmost and lowest) selected cell.
Return Value
The selected cell (NSCell).
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hselectedCellInColumn:
Returns the last (lowest) cell selected in the given column.
Parameters
- column
The column whose last selected cell is to be returned.
Return Value
The last (or lowest) selected cell.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.hselectedCells
Returns all cells selected in the rightmost column.
Return Value
An array of NSCell objects representing the selected cells in the rightmost browser column.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hselectedColumn
Returns the index of the last column with a selected item.
Return Value
The index of the last column with a selected item, or -1 if there is no column selected.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hselectedRowInColumn:
Returns the row index of the selected cell in the specified column.
Parameters
- column
The column index specifying the column for which to return the selected row.
Return Value
The row index of the selected cell in the specified column.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.hselectedRowIndexesInColumn:
Provides the indexes of the selected rows in a given column of the browser.
Parameters
- columnIndex
The column whose selected rows are provided.
Return Value
Rows selected in column columnIndex.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSBrowser.hselectionIndexPath
Returns the index path of the item selected in the browser.
Return Value
The index path of the selected item, or nil if there is no selection.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hselectionIndexPaths
Returns an array containing the index paths of all items selected in the browser.
Return Value
The array containing the index paths of the selected items.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hselectRow:inColumn:
Selects the cell at the specified row and column index.
Parameters
- row
The row index of the cell to select.
- column
The column index of the cell to select.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hselectRowIndexes:inColumn:
Specifies the selected rows in a given column of the browser.
Parameters
- rowIndexes
Rows to be selected in column columnIndex.
- columnIndex
Column in which to select rows rowIndexes.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSBrowser.hsendAction
Sends the action message to the target.
Return Value
YES if successful; NO if no target for the message could be found.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsendsActionOnArrowKeys
Returns whether pressing an arrow key causes an action message to be sent.
Return Value
NO if pressing an arrow key scrolls the browser; YES if it also sends the action message specified by setAction:.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hseparatesColumns
Indicates whether columns are separated by bezeled borders.
Return Value
YES if the browser's columns are separated by bezeled borders; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetAllowsBranchSelection:
Allows the user to select branch items.
Parameters
- flag
YESif the user can select branch items when multiple selection is enabled; otherwise,NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetAllowsEmptySelection:
Allows the user to select nothing.
Parameters
- flag
YESif the browser allows an empty selection; otherwise,NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetAllowsMultipleSelection:
Allows the user to select multiple items.
Parameters
- flag
YESif the user can select multiple items at once; otherwise,NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetAllowsTypeSelect:
Allows the browser to accept keystroke-based selection.
Parameters
- allowsTypeSelection
YESto allow type selection;NOto disallow it.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSBrowser.hsetAutohidesScroller:
Allows the browser to hide its scroller automatically.
Parameters
- flag
If
YES, the browser hides its scroller automatically; ifNO, it does not.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hsetBackgroundColor:
Specifies the browser’s background color.
Parameters
- backgroundColor
[NSColor clearColor]specifies a transparent background.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSBrowser.hsetCellClass:
Sets the class of the cell to be used by the matrices in the columns of the browser.
Parameters
- factoryId
The class of
NSCellused by the matrices in the columns of the browser. This method creates an instance of the class and callssetCellPrototype:.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.hsetCellPrototype:
Sets the prototype cell for displaying items in the matrices in the columns of the browser.
Parameters
- aCell
The prototype
NSCellinstance.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetColumnResizingType:
Sets the browser’s column resizing type.
Parameters
- columnResizingType
The column resizing type. Possible values are described in
“NSBrowserColumnResizingType”. The default isNSBrowserAutoColumnResizing. This setting is persistent.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSBrowser.hsetColumnsAutosaveName:
Sets the name used to automatically save the browser’s column configuration.
Parameters
- 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.
Discussion
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.
Availability
- Available in OS X v10.3 and later.
Declared In
NSBrowser.hsetDefaultColumnWidth:
Sets the default column width for new browser columns that do not otherwise have an initial width from defaults or the browser’s delegate.
Parameters
- columnWidth
The default column width to set.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hsetDelegate:
Sets the browser’s delegate.
Parameters
- anObject
The object to set at the browser's delegate.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetDoubleAction:
Sets the browser’s double-click action.
Parameters
- aSelector
The action method to invoke when the browser is double-clicked.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetDraggingSourceOperationMask:forLocal:
Specifies the drag-operation mask for dragging operations with local or external destinations.
Parameters
- dragOperationMask
Dragging operation mask to use for either local or external drag operations, as specified by localDestination.
- localDestination
Indicates the location of the dragging operation’s destination object:
YESfor this application;NOfor another application.
Discussion
Availability
- Available in OS X v10.5 and later.
Declared In
NSBrowser.hsetHasHorizontalScroller:
Sets whether the browser has a scroller to scroll horizontally.
Parameters
- flag
YESif the browser uses anNSScrollerobject to scroll horizontally; otherwise,NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetLastColumn:
Sets the last column.
Parameters
- column
The index of the last column.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetMatrixClass:
Sets the matrix class to be used in the browser’s columns.
Parameters
- factoryId
The matrix class (
NSMatrixor anNSMatrixsubclass) used in the browser's columns.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetMaxVisibleColumns:
Sets the maximum number of columns that can be displayed.
Parameters
- columnCount
The maximum number of visible columns.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetMinColumnWidth:
Sets the minimum column width.
Parameters
- columnWidth
The minimum column width, in pixels.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetPath:
Sets the path to be displayed by the browser.
Parameters
- 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.
Return Value
YES if the given path is valid; otherwise, NO.
Discussion
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.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetPathSeparator:
Sets the path separator.
Parameters
- newString
The new path separator.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetPrefersAllColumnUserResizing:
Causes the browser to resize all column simultaneously rather than resize a single column at a time.
Parameters
- prefersAllColumnResizing
YESto 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 (seeNSBrowserUserColumnResizing. Holding down the Option key while resizing switches the type of resizing used. This setting is persistent.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSBrowser.hsetReusesColumns:
Specifies whether matrices can be reused.
Parameters
- flag
YESto preventNSMatrixobjects from being freed when their columns are unloaded, so they can be reused; otherwise,NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetRowHeight:
Sets the height of the browser’s rows to the specified value.
Parameters
- height
The new height to set.
Discussion
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.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hsetSelectionIndexPath:
Sets the browser’s selection to the item with the specified path.
Parameters
- path
The path of the item to select.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hsetSelectionIndexPaths:
Sets the browser’s selection to the items whose index paths are in the specified array.
Parameters
- paths
The array containing the index paths of the items to select.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSBrowser.hsetSendsActionOnArrowKeys:
Allows the specified action message to be sent when the user presses an arrow key.
Parameters
- flag
YESif pressing an arrow key should send the action message specified bysetAction:in addition to scrolling the browser;NOif it should only scroll the browser.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetSeparatesColumns:
Separates columns with bezeled borders.
Parameters
- flag
YESif the browser's columns should be separated by bezeled borders; otherwise,NO. This value is ignored ifisTitleddoes not returnNO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetTakesTitleFromPreviousColumn:
Sets whether the title of a column is set to the string value of the selected cell in the previous column.
Parameters
- flag
YESif the title of a column should be set to the string value of the selectedNSCellin the previous column; otherwise,NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetTitle:ofColumn:
Sets the title of the given column.
Parameters
- aString
The title of the column.
- column
The index of the column whose title should be set.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.hsetTitled:
Sets columns to display titles.
Parameters
- flag
YESif the columns in a browser display titles; otherwise,NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hsetWidth:ofColumn:
Sets the width of the specified column.
Parameters
- columnWidth
The new width of the specified column.
- columnIndex
The index of the column for which to set the width.
Discussion
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.
Availability
- Available in OS X v10.3 and later.
See Also
-
– widthOfColumn: -
browser:shouldSizeColumn:forUserResize:toWidth:(NSBrowserDelegate)
Declared In
NSBrowser.htakesTitleFromPreviousColumn
Indicates whether a column takes its title from the selected cell in the previous column.
Return Value
YES if the title of a column is set to the string value of the selected NSCell in the previous column; otherwise, NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.htile
Adjusts the various subviews of the browser—scrollers, columns, titles, and so on—without redrawing.
Discussion
Your code shouldn’t send this message. It’s invoked any time the appearance of the browser changes.
Availability
- Available in OS X v10.0 and later.
Declared In
NSBrowser.htitleFrameOfColumn:
Returns the bounds of the title frame for the specified column.
Parameters
- column
The index of the column for which to return the title frame.
Return Value
The rectangle specifying the bounds of the column's title frame.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.htitleHeight
Returns the height of the column titles.
Return Value
The height of the column titles for the browser.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.htitleOfColumn:
Returns the title displayed for the given column.
Parameters
- column
The index of the column for which to get the title.
Return Value
The title of the specified column.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hvalidateVisibleColumns
Validates the browser’s visible columns.
Discussion
This method invokes the delegate method browser:isColumnValid:
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSBrowser.hConstants
NSBrowserColumnResizingType
Types of browser column resizing.
enum {
NSBrowserNoColumnResizing = 0,
NSBrowserAutoColumnResizing = 1,
NSBrowserUserColumnResizing = 2
};
typedef NSUInteger NSBrowserColumnResizingType;
Constants
NSBrowserNoColumnResizingNeither
NSBrowsernor the user can change the column width. The developer must explicitly set all column widths.Available in 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 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 OS X v10.3 and later.
Declared in
NSBrowser.h.
Discussion
These constants are used by the setColumnResizingType: and columnResizingType methods.
NSBrowserDropOperation
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;
Constants
NSBrowserDropOnThe drop occurs at the row to which the item was dragged.
Available in OS X v10.5 and later.
Declared in
NSBrowser.h.NSBrowserDropAboveThe drop occurs above the row to which the item was dragged.
Available in OS X v10.5 and later.
Declared in
NSBrowser.h.
Declared In
NSBrowser.hApplication Kit Versions for NSBrowser Functionality
The version of the AppKit.framework containing a specific bug fix or capability.
#define NSAppKitVersionNumberWithContinuousScrollingBrowser 680.0 #define NSAppKitVersionNumberWithColumnResizingBrowser 685.0
Constants
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 OS X v10.3 and earlier.
Available in 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 OS X v10.3 and earlier.
Available in OS X v10.3 and later.
Declared in
NSBrowser.h.
Notifications
NSBrowserColumnConfigurationDidChangeNotification
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
NSBrowser.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-08-28)