# nodesnim/nodescontrol/vbox

Dark Mode

Search:
Group by:

Contains children in the vertical box.

# Imports

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

# Types

    VBoxObj = object of BoxObj
      separator*: float

    VBoxRef = ref VBoxObj

# Procs

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

  Creates a new VBox.

  Arguments:

  - `name` is a node name.

  Examples:

      var box = VBox("VBox")

# Methods

    method getChildSize(self: VBoxRef): Vector2Ref {...}{.raises: [], tags: [].}

  Returns size of all children.

    method addChild(self: VBoxRef; child: NodeRef) {...}{.raises: [], tags: [].}

  Adds new child in current node.

  Arguments:

  - `child`: other node.

    method draw(self: VBoxRef; w, h: GLfloat) {...}{.raises: [GLerror, Exception],
                                          tags: [RootEffect].}

  This uses in the `window.nim`.

    method duplicate(self: VBoxRef): VBoxRef {...}{.base, raises: [], tags: [].}

  Duplicate VBox object and create a new VBox.

    method resize(self: VBoxRef; w, h: GLfloat) {...}{.raises: [], tags: [].}

  Resizes VBox, if available.

  Arguments:

  - `w` is a new width.
  - `h` is a new height.