Containers - ZvontyFlugence/NiGui GitHub Wiki

Here you can find anything you need to know about Containers in NiGui. There are currently 2 types of Containers in NiGui - Layout Containers, and the regular Containers. They both function the same in every way, with the exception that Layout Containers use NiGui's own layout manager, which can assist you in organizing your application's layout.

Container Properties

Below is the declaration of the Container and Layout Container types. Here you can see their parent objects, and their various properties.
Container:

type Container* = ref object of ControlImpl
    fFrame: Frame
    fChildControls: seq[Control]

LayoutContainer:

type LayoutContainer* = ref object of ContainerImpl
    fLayout: Layout
    fXAlign: XAlign
    fYAlign: YAlign
    fPadding: int
    fSpacing: int

Container Procedures and Methods

Here are all of the currently available procedures and methods associated with the Container, and thus the Layout Container, type.

proc newContainer*(): Container

proc init*(container: Container)
proc init*(container: ContainerImpl)

method frame*(container: Container): Frame
method `frame=`*(container: Container, frame: Frame)

method add*(container: Container, control: Control)
method remove*(container: Container, control: Control)

method getPadding*(container: Container): Spacing

method setInnerSize*(container: Container, width, height: int)

Please note that all of the above methods (not procs) will function with the LayoutContainer type as well. LayoutContainer Procs and Methods:

proc newLayoutContainer*(layout: Layout): Layout

method layout*(container: LayoutContainer): Layout
method `layout=`*(container: LayoutContainer, layout: Layout)

method xAlign*(container: LayoutContainer): XAlign
method `xAlign=`*(container: LayoutContainer, xAlign: XAlign)

method yAlign*(container: LayoutContainer): YAlign
method `yAlign=`*(container: LayoutContainer, yAlign: YAlign)

method padding*(container: LayoutContainer): int
method `padding=`*(container: LayoutContainer, padding: int)

method spacing*(container: LayoutContainer): int
method `spacing=`*(container: LayoutContainer, spacing: int)
⚠️ **GitHub.com Fallback** ⚠️