Mac Developer Library

Developer

AppKit Framework Reference NSTextTable Class Reference

Options
Deployment Target:

On This Page
Language:

NSTextTable

Inheritance


Conforms To


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.4 and later.

An NSTextTable object represents a text table as a whole. It is responsible for laying out and drawing the text table blocks it contains, and it maintains the basic parameters of the table.

  • The number of columns in the text table.

    Declaration

    Swift

    var numberOfColumns: Int

    Objective-C

    @property NSUInteger numberOfColumns

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • The text table layout algorithm.

    Declaration

    Swift

    var layoutAlgorithm: NSTextTableLayoutAlgorithm

    Objective-C

    @property NSTextTableLayoutAlgorithm layoutAlgorithm

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • A Boolean value indicating whether the text table borders are collapsible.

    Declaration

    Swift

    var collapsesBorders: Bool

    Objective-C

    @property BOOL collapsesBorders

    Discussion

    The value of this property is YEStrue when the text table borders are collapsible.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • A Boolean value indicating whether the text table hides empty cells.

    Declaration

    Swift

    var hidesEmptyCells: Bool

    Objective-C

    @property BOOL hidesEmptyCells

    Discussion

    The value of this property is YEStrue when the text table hides empty cells. If empty cells are hidden, locations with empty cells allow the background of the enclosing block or text container to show through.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the rectangle within which glyphs should be laid out for a text table block.

    Declaration

    Swift

    func rectForBlock(_ block: NSTextTableBlock, layoutAtPoint startingPoint: NSPoint, inRect rect: NSRect, textContainer textContainer: NSTextContainer, characterRange charRange: NSRange) -> NSRect

    Objective-C

    - (NSRect)rectForBlock:(NSTextTableBlock *)block layoutAtPoint:(NSPoint)startingPoint inRect:(NSRect)rect textContainer:(NSTextContainer *)textContainer characterRange:(NSRange)charRange

    Parameters

    block

    The text table block that wants to determine where to layout its glyphs.

    startingPoint

    The location, in container coordinates, where layout begins.

    rect

    The rectangle in which the block is constrained to lie. For top-level blocks, this is the container rectangle of textContainer; for nested blocks, this is the layout rectangle of the enclosing block.

    textContainer

    The text container being used for the layout.

    charRange

    The range of the characters whose glyphs are to be drawn.

    Return Value

    The rectangle within which glyphs should be laid out.

    Discussion

    This method is called by the text table block block to determine the rectangle within which glyphs should be laid out for the text table block.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the rectangle the text table block actually occupies, including padding, borders, and margins.

    Declaration

    Swift

    func boundsRectForBlock(_ block: NSTextTableBlock, contentRect contentRect: NSRect, inRect rect: NSRect, textContainer textContainer: NSTextContainer, characterRange charRange: NSRange) -> NSRect

    Objective-C

    - (NSRect)boundsRectForBlock:(NSTextTableBlock *)block contentRect:(NSRect)contentRect inRect:(NSRect)rect textContainer:(NSTextContainer *)textContainer characterRange:(NSRange)charRange

    Parameters

    block

    The text table block that wants to determine where to layout its glyphs.

    contentRect

    The actual rectangle in which the text was laid out, as determined by rectForLayoutAtPoint:inRect:textContainer:characterRange:.

    rect

    The initial rectangle in textContainer proposed by the typesetter.

    textContainer

    The text container being used for the layout.

    charRange

    The range of the characters whose glyphs are to be drawn.

    Return Value

    The rectangle the text table block actually occupies, including padding, borders, and margins.

    Discussion

    This method is called by the text table block block after it is laid out to determine the rectangle the text table block actually occupies, including padding, borders, and margins.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Draws any colors and other decorations for a text table block.

    Declaration

    Swift

    func drawBackgroundForBlock(_ block: NSTextTableBlock, withFrame frameRect: NSRect, inView controlView: NSView, characterRange charRange: NSRange, layoutManager layoutManager: NSLayoutManager)

    Objective-C

    - (void)drawBackgroundForBlock:(NSTextTableBlock *)block withFrame:(NSRect)frameRect inView:(NSView *)controlView characterRange:(NSRange)charRange layoutManager:(NSLayoutManager *)layoutManager

    Parameters

    block

    The text table block that wants to draw its background.

    frameRect

    The area in which drawing occurs.

    controlView

    The view controlling the drawing.

    charRange

    The range of the characters whose glyphs are to be drawn.

    layoutManager

    The layout manager controlling the typesetting.

    Discussion

    This methods is called by the text table block block to draw any colors and other decorations before the text is drawn.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • These constants, specifying the type of text table layout algorithm, are used with layoutAlgorithm.

    Declaration

    Swift

    enum NSTextTableLayoutAlgorithm : UInt { case AutomaticLayoutAlgorithm case FixedLayoutAlgorithm }

    Objective-C

    enum { NSTextTableAutomaticLayoutAlgorithm = 0, NSTextTableFixedLayoutAlgorithm = 1 }; typedef NSUInteger NSTextTableLayoutAlgorithm;

    Constants

    • AutomaticLayoutAlgorithm

      NSTextTableAutomaticLayoutAlgorithm

      Specifies automatic layout algorithm

      Available in OS X v10.4 and later.

    • FixedLayoutAlgorithm

      NSTextTableFixedLayoutAlgorithm

      Specifies fixed layout algorithm

      Available in OS X v10.4 and later.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.