# nodesnim/nodescontrol/grid_box

Dark Mode

Search:
Group by:

Contains children in grid.

# Imports

../thirdparty/opengl, ../core/vector2, ../core/rect2, ../core/anchor, ../core/input, ../core/enums, ../nodes/node, control, box

# 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.

  Examples:

      var grid = GridBox("GridBox")

# Methods

    method getMaxChildSize(self: GridBoxRef): Vector2Ref {...}{.base, raises: [], tags: [].}

    method getChildSize(self: GridBoxRef): Vector2Ref {...}{.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) {...}{.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.