nodesnim/nodescontrol/subwindow

Extended version of SubWindow node.

Types

SubWindowObj = object of PopupObj
  left_taked*, right_taked*, top_taked*, bottom_taked*: bool
  title_taked*: bool
  icon*: GlTextureObj
  title_bar*: DrawableRef
  title_taked_pos*: Vector2Obj
  title*: StyleText
SubWindowRef = ref SubWindowObj

Procs

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

Creates a new SubWindow.

Arguments:

  • name is a node name.

Example:

var window = SubWindow("SubWindow")

Methods

method bringToFront(self: SubWindowRef) {...}{.base, raises: [], tags: [].}
method close(self: SubWindowRef) {...}{.base, raises: [Exception], tags: [RootEffect].}
Closes the window. alias of hide() method.
method draw(self: SubWindowRef; w, h: GLfloat) {...}{.
    raises: [GLerror, Exception, ResourceError], tags: [RootEffect].}
This uses in the window.nim.
method duplicate(self: SubWindowRef): SubWindowRef {...}{.base, raises: [], tags: [].}
Duplicates SubWindow object and create a new SubWindow.
method handle(self: SubWindowRef; event: InputEvent; mouse_on: var NodeRef) {...}{.
    raises: [Exception], tags: [RootEffect].}
This uses in the window.nim.
method open(self: SubWindowRef) {...}{.base, raises: [Exception], tags: [RootEffect].}
Opens the window. alias of show() method.
method resize(self: SubWindowRef; w, h: float) {...}{.base, raises: [], tags: [].}

Resizes subwindow, if available.

Arguments:

  • w is a new width.
  • h is a new height.
method setBorderColor(self: SubWindowRef; color: ColorRef) {...}{.base, raises: [],
    tags: [].}

Changes border color.

Arguments:

  • color is a new border color.
method setIcon(self: SubWindowRef; gltexture: GlTextureObj) {...}{.base,
    raises: [GLerror], tags: [].}

Changes icon.

Arguments:

  • gltexture is a texture, loaded via load(file, mode=GL_RGB).
method setIcon(self: SubWindowRef; file: string) {...}{.base,
    raises: [GLerror, ResourceError], tags: [].}

Loads icon from file.

Arguments:

  • file is an image file path.
method setTitleBarColor(self: SubWindowRef; color: ColorRef) {...}{.base, raises: [],
    tags: [].}

Changes title bar color.

Arguments:

  • color is a new title bar color.
method setTitle(self: SubWindowRef; title: string) {...}{.base, raises: [], tags: [].}

Changes subwindow title.

Arguments:

  • title is a new title.