# nodesnim/nodescontrol/hbox

Dark Mode

Search:
Group by:

Contains children in horizontal box.

# Imports

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

# Types

    HBoxObj = object of BoxObj
      separator*: float

    HBoxRef = ref HBoxObj

# Procs

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

  Creates a new HBox.

  Arguments:

  - `name` is a node name.

  Examples:

      var grid = HBox("HBox")

# Methods

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

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

  Adds new child in current node.

  Arguments:

  - `child`: other node.

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

  This uses in the `window.nim`.

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

  Duplicates HBox object and create a new HBox.

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

  Resizes HBox, if `w` and `h` not less than child size.

  Arguments:

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