TableView

A View sublass that represents Cocoa’s NSTableView. Note that although it’s a view and that views are added to their superview, xibless wraps the view into a NSScrollView and adds that view to the superview (XCode does the same). The reference to the table view, however (if you do stuff like owner.table = Table(superview)) will be the reference of the NSTableView instance.

class TableView(parent)
Parameters:parent – A View instance. Same as View.parent.
addColumn(identifier, title, width)
Parameters:

Creates a TableColumn and adds it to self. The created item is returned by the method.

allowsColumnReordering
allowsColumnResizing
allowsColumnSelection
allowsEmptySelection
allowsMultipleSelection
allowsTypeSelect

Boolean. Sets the corresponding flag in NSTableView. Default values are the same as in NSTableView.

alternatingRows

Boolean. Whether rows have an alternating background colors. In Cocoa, it’s usesAlternatingRowBackgroundColors.

gridStyleMask

Cocoa constant. Style of the table grid lines, if any. Use NSTableViewGridLineStyle constants.

borderType

Cocoa constant. Border type of the enclosing scroll view. Use NSBorderType constants.

font
editable

If you set these attributes before adding your columns, all added columns will copy this attribute.

ListView

A convenience subclass of TableView. It also represents a NSTableView, but it sets the table so that it has only one column that resizes with the table and no header view.

class ListView(parent)
Parameters:parent – A View instance. Same as View.parent.

OutlineView

A TableView sublass that represents Cocoa’s NSOutlineView.

class OutlineView(parent)
Parameters:parent – A View instance. Same as View.parent.

TableColumn

The TableColumn is created by TableView.addColumn() and represents a NSTableColumn. You shouldn’t create it directly, but you can set its attributes.

class TableColumn(table, identifier, title, width)
Parameters:
identifier

String. The identifier of the column.

title

String. The title of the column. In Cocoa: headerCell.stringValue.

width

Integer. The width of the column.

font

Font. The font of the column. In Cocoa: dataCell.font.

editable

Boolean. Whether the column can be edited.

userResizable

Boolean. Whether the user can resize the column.

autoResizable

Boolean. Whether the column resizes itself when the table is resized.

dataCell

Control instance. Sets the column’s dataCell attribute to the control’s cell. During code generation, the code will look like [column setDataCell:[control cell]].

Table Of Contents

Previous topic

TabView

Next topic

SplitView

This Page