# nodesnim/nodescontrol/progress_bar

Dark Mode

Search:
Group by:

It provides primitive display progress.

# Imports

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

# Types

    ProgressBarObj = object of ControlRef
      max_value*, value*: uint
      progress_color*: ColorRef

    ProgressBarRef = ref ProgressBarObj

# Procs

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

  Creates a new ProgressBar.

  Arguments:

  - `name` is a node name.

  Examples:

      var p = ProgressBar("ProgressBar")

# Methods

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

  This uses in the `window.nim`.

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

  Duplicates ProgressBar object and create a new ProgressBar.

    method setMaxValue(self: ProgressBarRef; value: uint) {...}{.base, raises: [], tags: [].}

  Changes max value.

    method setProgress(self: ProgressBarRef; value: uint) {...}{.base, raises: [], tags: [].}

  Changes progress.

    method setProgressColor(self: ProgressBarRef; color: ColorRef) {...}{.base, raises: [],
        tags: [].}

  Changes progress color. For change background color use `setBackgroundColor` method.