nodesnim/nodescontrol/grid_box

Contains children in grid.

Types

GridBoxObj = object of BoxObj
  separator*: float
  row*: int
GridBoxRef = ref GridBoxObj

Procs

proc GridBox(name: string = "GridBox"): GridBoxRef {...}{.raises: [], tags: [].}

Creates a new GridBox.

Arguments:

  • name is a node name.

Example:

var grid = GridBox("GridBox")

Methods

method getMaxChildSize(self: GridBoxRef): Vector2Obj {...}{.base, raises: [],
    tags: [].}
method getChildSize(self: GridBoxRef): Vector2Obj {...}{.raises: [], tags: [].}
Returns size with all childs.
method addChild(self: GridBoxRef; child: NodeRef) {...}{.raises: [], tags: [].}

Adds new child in current node.

Arguments:

  • child: other node.
method draw(self: GridBoxRef; w, h: GLfloat) {...}{.raises: [GLerror, Exception],
    tags: [RootEffect].}
This method uses in the window.nim.
method duplicate(self: GridBoxRef): GridBoxRef {...}{.base, raises: [], tags: [].}
Duplicates GridBox object and create a new GridBox.
method resize(self: GridBoxRef; w, h: GLfloat; save_anchor: bool = false) {...}{.
    raises: [], tags: [].}

Resizes GridBox.

Arguments:

  • w is a new width.
  • h is a new height.
method setRow(self: GridBoxRef; row: int) {...}{.base, raises: [], tags: [].}
Changes gridBox row count.
method setSeparator(self: GridBoxRef; separator: float) {...}{.base, raises: [],
    tags: [].}
Changes separator between child nodes.