uing

Search:
Group by:
Source   Edit  

High level wrapper for libui-ng.

Documentation mainly from ui.h

Author:Jasmine

See also

Types

Area = ref object of Widget
  scrolling*: bool
Source   Edit  
Attribute = ref object
  

Attribute stores information about an attribute in a AttributedString.

You do not create Attributes directly; instead, you create a Attribute of a given type using the specialized constructor functions. For every Unicode codepoint in the AttributedString, at most one value of each attribute type can be applied.

Attributes are immutable.

Source   Edit  
AttributedString = ref object
  

AttributedString represents a string of UTF-8 text that can optionally be embellished with formatting attributes. libui-ng provides the list of formatting attributes, which cover common formatting traits like boldface and color as well as advanced typographical features provided by OpenType like superscripts and small caps. These attributes can be combined in a variety of ways.

Attributes are applied to runs of Unicode codepoints in the string. Zero-length runs are elided. Consecutive runs that have the same attribute type and value are merged. Each attribute is independent of each other attribute; overlapping attributes of different types do not split each other apart, but different values of the same attribute type do.

The empty string can also be represented by AttributedString, but because of the no-zero-length-attribute rule, it will not have attributes.

A AttributedString takes ownership of all attributes given to it, as it may need to duplicate or delete Attribute objects at any time. By extension, when you free a AttributedString, all Attributes within will also be freed. Each method will describe its own rules in more details.

In addition, AttributedString provides facilities for moving between grapheme clusters, which represent a character from the point of view of the end user. The cursor of a text editor is always placed on a grapheme boundary, so you can use these features to move the cursor left or right by one "character".

AttributedString does not provide enough information to be able to draw itself onto a DrawContext or respond to user actions. In order to do that, you'll need to use a DrawTextLayout, which is built from the combination of a AttributedString and a set of layout-specific properties.

Source   Edit  
Box = ref object of Widget
  children*: seq[Widget]     ## The widgets contained within the box.
  

A boxlike container that holds a group of widgets.

The contained widgets are arranged to be displayed either horizontally or vertically next to each other.

Source   Edit  
Button = ref object of Widget
  onclick*: proc (sender: Button) ## callback for when the button is clicked.
  
A widget that visually represents a button to be clicked by the user to trigger an action. Source   Edit  
Checkbox = ref object of Widget
  ontoggled*: proc (sender: Checkbox) ## callback for when the checkbox is toggled by the user.
  
A widget with a user checkable box accompanied by a text label. Source   Edit  
ColorButton = ref object of Widget
  onchanged*: proc (sender: ColorButton) ## Callback for when the color is changed.
  

A widget with a color indicator that opens a color chooser when clicked.

The widget visually represents a button with a color field representing the selected color.

Clicking on the button opens up a color chooser in form of a color palette.

Source   Edit  
Combobox = ref object of Widget
  items*: seq[string]        ## List of items in the combobox
  onselected*: proc (sender: Combobox) ## Callback for when a combo box item is selected.
  
A widget to select one item from a predefined list of items via a drop down menu. Source   Edit  
DateTimePicker = ref object of Widget
  onchanged*: proc (sender: DateTimePicker) ## Callback for when the date time picker value is changed by the user.
  

A widget to enter a date and/or time.

All functions assume local time and do NOT perform any time zone conversions.

Source   Edit  
DrawPath = ref object
  
Source   Edit  
DrawTextLayout = ref object
  

DrawTextLayout is a concrete representation of a AttributedString that can be displayed in a DrawContext. It includes information important for the drawing of a block of text, including the bounding box to wrap the text within, the alignment of lines of text within that box, areas to mark as being selected, and other things.

Unlike AttributedString, the content of a DrawTextLayout is immutable once it has been created.

Note: There are OS-specific differences with text drawing that libui-ng can't account for
Source   Edit  
EditableCombobox = ref object of Widget
  items*: seq[string]        ## Predefined text items in the combo box
  onchanged*: proc (sender: EditableCombobox) ## Callback for when an editable combo box item is selected or user text changed.
  

A widget to select one item from a predefined list of items or enter ones own.

Predefined items can be selected from a drop down menu.

A customary item can be entered by the user via an editable text field.

Source   Edit  
Entry = ref object of Widget
  onchanged*: proc (sender: Entry) ## Callback for when the user changes the entry's text.
  
A widget with a single line text entry field. Source   Edit  
FontButton = ref object of Widget
  onchanged*: proc (sender: FontButton) ## Callback for when the font is changed.
  
A button-like widget that opens a font chooser when clicked. Source   Edit  
Form = ref object of Widget
  chlidren*: seq[tuple[label: string, widget: Widget]]

A container widget to organize contained widgets as labeled fields.

As the name suggests this container is perfect to create ascetically pleasing input forms.

Each widget is preceded by it's corresponding label.

Labels and containers are organized into two panes, making both labels and containers align with each other.

Source   Edit  
Grid = ref object of Widget
  children*: seq[Widget]

A widget container to arrange containing widgets in a grid.

Contained widgets are arranged on an imaginary grid of rows and columns. Widgets can be placed anywhere on this grid, spanning multiple rows and/or columns.

Additionally placed widgets can be programmed to expand horizontally and/or vertically, sharing the remaining space among other expanded widgets.

Alignment options are available via Align attributes to determine the widgets placement within the reserved area, should the area be bigger than the widget itself.

Widgets can also be placed in relation to other widget using At attributes.

Source   Edit  
Group = ref object of Widget
  

A widget container that adds a label to the contained child widget.

This widget is a great way of grouping related widgets in combination with Box.

A visual box will or will not be drawn around the child widget dependent on the underlying OS implementation.

Source   Edit  
Image = ref object of Widget
  

A container for an image to be displayed on screen.

The container can hold multiple representations of the same image with the same aspect ratio but in different resolutions to support high-density displays.

Common image dimension scale factors are 1x and 2x. Providing higher density representations is entirely optional.

The system will automatically determine the correct image to render depending on the screen's pixel density.

Image only supports premultiplied 32-bit RGBA images.

No image file loading or image format conversion utilities are provided.

Source   Edit  
Label = ref object of Widget
  
A widget that displays non interactive text. Source   Edit  
MultilineEntry = ref object of Widget
  onchanged*: proc (sender: MultilineEntry) ## Callback for when the user changes the multi line entry's text.
  
A widget with a multi line text entry field. Source   Edit  
OpenTypeFeatures = ref object
  

OpenTypeFeatures represents a set of OpenType feature tag-value pairs, for applying OpenType features to text. OpenType feature tags are four-character codes defined by OpenType that cover things from design features like small caps and swashes to language-specific glyph shapes and beyond. Each tag may only appear once in any given OpenTypeFeatures instance. Each value is a 32-bit integer, often used as a Boolean flag, but sometimes as an index to choose a glyph shape to use.

If a font does not support a certain feature, that feature will be ignored.

See the OpenType specification at https://www.microsoft.com/typography/otspec/featuretags.htm for the complete list of available features, information on specific features, and how to use them.

Source   Edit  
ProgressBar = ref object of Widget
  

A widget that visualizes the progress of a task via the fill level of a horizontal bar.

Indeterminate values are supported via an animated bar.

Source   Edit  
RadioButtons = ref object of Widget
  items*: seq[string]        ## Seq of text of the radio buttons 
  onselected*: proc (sender: RadioButtons) ## Callback for when radio button is selected.
  
A multiple choice widget of check buttons from which only one can be selected at a time. Source   Edit  
Separator = ref object of Widget
  
A widget to visually separate widget, horizontally or vertically. Source   Edit  
Slider = ref object of Widget
  onchanged*: proc (sender: Slider) ## Callback for when the slider value is changed by the user.
  onreleased*: proc (sender: Slider) ## Callback for when the slider is released from dragging.
  

A widget to display and modify integer values via a user draggable slider.

Values are guaranteed to be within the specified range.

Sliders by default display a tool tip showing the current value when being dragged.

Sliders are horizontal only.

Source   Edit  
Spinbox = ref object of Widget
  onchanged*: proc (sender: Spinbox) ## Callback for when the spinbox value is changed by the user.
  

A widget to display and modify integer values via a text field or +/- buttons.

This is a convenient widget for having the user enter integer values. Values are guaranteed to be within the specified range.

The + button increases the held value by 1.

The - button decreased the held value by 1.

Entering a value out of range will clamp to the nearest value in range.

Source   Edit  
Tab = ref object of Widget
  tabs*: seq[tuple[name: string, widget: Widget]]

A multi page widget interface that displays one page at a time.

Each page/tab has an associated label that can be selected to switch between pages/tabs.

Source   Edit  
Table = ref object of Widget
  onRowClicked*: proc (sender: Table; row: int) ## Callback for when the user single clicks a table row.
  onRowDoubleClicked*: proc (sender: Table; row: int) ## Callback for when the user double clicks a table row.
  onHeaderClicked*: proc (sender: Table; column: int) ## Callback for when a table column header is clicked.
  onSelectionChanged*: proc (sender: Table) ## Callback for when the table selection changed.
  

A widget to display data in a tabular fashion.

The view of the architecture.

Data is retrieved from a TableModel via methods that you need to define in a TableModelHandler.

Make sure the TableModel columns return the right type, as specified in the addColumn() parameters.

The EditableModelColumn parameters typically point to a TableModel column index, that specifies the property on a per row basis.

They can however also be passed two special values defining the property for all rows: TableModelColumnNeverEditable and TableModelColumnAlwaysEditable.

Source   Edit  
TableModel = ref object
  

Table model delegate to retrieve data and inform about model changes.

This is a wrapper around TableModelHandler where the actual data is held.

The main purpose it to provide methods to the developer to signal that underlying data has changed.

Row indexes match both the row indexes in Table and TableModelHandler.

A TableModel can be used as the backing store for multiple Table views.

Once created, the number of columns and their data types are not allowed to change.

Error: Not informing the TableModel about out-of-band data changes is an error. User edits via Table do not fall in this category.
Source   Edit  
TableValue = ref object
  

Container to store values used in container related methods.

TableValue objects are immutable.

Source   Edit  
Widget = ref object of RootRef
  internalImpl*: pointer
abstract Widget base class. Source   Edit  
Window = ref object of Widget
  onclosing*: proc (sender: Window): bool ## Callback for when the window is to be closed.
  onfocuschanged*: proc (sender: Window) ## Callback for when the window focus changes.
  onContentSizeChanged*: proc (sender: Window) ## Callback for when the window content size is changed.
  onPositionChanged*: proc (sender: Window) ## Callback for when the window moved.
  

A Widget that represents a top-level window.

A window contains exactly one child widget that occupies the entire window.

Note: Many of the Window methods should be regarded as mere hints. The underlying system may override these or even choose to ignore them completely. This is especially true for many Unix systems.
Warning: A Window can NOT be a child of another Widget.
Source   Edit  

Procs

proc `$`(s: AttributedString): string {....raises: [], tags: [], forbids: [].}
Returns the textual content of s as a string. Source   Edit  
proc `$`(v: TableValue): string {....raises: [ValueError], tags: [], forbids: [].}

Returns the string value held internally.

To be used only on TableValue objects of type TableValueTypeString.

v:Table value.
Source   Edit  
proc add(b: Box; child: Widget; stretchy = false) {....raises: [], tags: [],
    forbids: [].}

Appends a widget to the box.

Stretchy items expand to use the remaining space within the box. In the case of multiple stretchy items the space is shared equally.

b:Box instance.
child:widget instance to append.
stretchy:true to stretch widget,false otherwise. Default is false.
Source   Edit  
proc add(c: Box; items: openArray[Widget]; stretchy = false) {....raises: [],
    tags: [], forbids: [].}
Adds multiple widgets to the box Source   Edit  
proc add(c: Combobox; items: varargs[string, `$`]) {....raises: [], tags: [],
    forbids: [].}
Appends an item to the combo box.
c:Combobox instance.
items:Item text(s).
Source   Edit  
proc add(c: EditableCombobox; items: varargs[string, `$`]) {....raises: [],
    tags: [], forbids: [].}
Appends an item to the editable combo box.
c:Combobox instance.
items:Item text(s).
Source   Edit  
proc add(e: MultilineEntry; text: string) {....raises: [], tags: [], forbids: [].}
Appends text to the multi line entry's text.
e:MultilineEntry instance
text:Text to append.
Source   Edit  
proc add(f: Form; label: string; w: Widget; stretchy: bool = false) {.
    ...raises: [], tags: [], forbids: [].}

Appends a widget with a label to the form.

Stretchy items expand to use the remaining space within the container. In the case of multiple stretchy items the space is shared equally.

f:Form instance.
label:Label text.
w:Widget to append.
stretchy:true to stretch widget, false otherwise.
Source   Edit  
proc add(g: Grid; w: Widget; left, top, xspan, yspan: int; hexpand: bool;
         halign: Align; vexpand: bool; valign: Align) {....raises: [], tags: [],
    forbids: [].}
Appends a widget to the grid.
g:Grid instance.
w:The widget to insert.
left:Placement as number of columns from the left. Integer in range of [INT_MIN, INT_MAX].
top:Placement as number of rows from the top. Integer in range of [INT_MIN, INT_MAX].
xspan:Number of columns to span. Integer in range of [0, INT_MAX].
yspan:Number of rows to span. Integer in range of [0, INT_MAX].
hexpand:true to expand reserved area horizontally, false otherwise.
halign:Horizontal alignment of the widget within the reserved space.
vexpand:true to expand reserved area vertically, false otherwise.
valign:Vertical alignment of the widget within the reserved space.
Source   Edit  
proc add(i: Image; pixels: pointer; pixelWidth: int; pixelHeight: int;
         byteStride: int) {....raises: [], tags: [], forbids: [].}
Appends a new image representation.
i:Image instance.
pixels:Pointer to byte array of premultiplied pixels in R G B A order. pixels[0] equals the R of the first pixel, [3] the A of the first pixel. pixels must be at least byteStride * pixelHeight bytes long.
pixelWidth:Width in pixels.
pixelHeight:Height in pixels.
byteStride:Number of bytes per row of the pixel array.
Source   Edit  
proc add(otf: OpenTypeFeatures; a, b, c, d: char; value: uint32) {....raises: [],
    tags: [], forbids: [].}
Adds the given feature tag and value to otf. The feature tag is specified by a, b, c, and d. If there is already a value associated with the specified tag in otf, the old value is removed. Source   Edit  
proc add(otf: OpenTypeFeatures; abcd: string; value: uint32 | bool)
Alias of add. a, b, c, and d are instead a string of 4 characters, each character representing a, b, c, and d respectively. Source   Edit  
proc add(r: RadioButtons; items: varargs[string, `$`]) {....raises: [], tags: [],
    forbids: [].}
Appends a radio button.
r:RadioButtons instance.
items:Radio button text(s).
Source   Edit  
proc add(t: Tab; name: string; w: Widget) {....raises: [], tags: [], forbids: [].}
Appends a widget in form of a page/tab with label.
t:Tab instance.
name:Label text.
w:Widget to append.
Source   Edit  
proc addAboutItem(m: Menu;
                  onclicked: proc (sender: MenuItem; window: Window) = nil): MenuItem {.
    discardable, ...raises: [], tags: [], forbids: [].}
Appends a new About menu item.
Warning: Only one such menu item may exist per application.
m:Menu instance.
onclicked:Callback for when the menu item is clicked.
Source   Edit  
proc addButtonColumn(table: Table; title: string; index, clickableMode: int) {.
    ...raises: [], tags: [], forbids: [].}

Appends a column to the table containing a button.

Button clicks are signaled to the TableModelHandler via a call to SetCellValue() with a value of NULL for the buttonModelColumn.

CellValue() must return the button text to display.

table:Table instance.
title:Column title text.
index:Column that holds the button text to be displayed.
clickableMode:Column that defines whether or not the button is clickable. TableModelColumnNeverEditable to make all rows never clickable. TableModelColumnAlwaysEditable to make all rows always clickable.
Source   Edit  
proc addCheckboxColumn(table: Table; title: string; index, editableMode: int) {.
    ...raises: [], tags: [], forbids: [].}
Appends a column to the table containing a checkbox.
t:Table instance.
title:Column title text.
index:Column that holds the data to be displayed.
editableMode:Column that defines whether or not the checkbox is editable. TableModelColumnNeverEditable to make all rows never editable. TableModelColumnAlwaysEditable to make all rows always editable.
Source   Edit  
proc addCheckboxTextColumn(t: Table; name: string; checkboxModelColumn,
    checkboxEditableModelColumn, textModelColumn, textEditableModelColumn: int;
                           textParams: ptr TableTextColumnOptionalParams = nil) {.
    ...raises: [], tags: [], forbids: [].}

Appends a column to the table containing a checkbox and text.

:t: Table instance. :name: Column title text. :checkboxModelColumn: Column that holds the data to be displayed. `true for a checked checkbox, false otherwise. :checkboxEditableModelColumn: Column that defines whether or not the checkbox is editable. `TableModelColumnNeverEditable to make all rows never editable. TableModelColumnAlwaysEditable to make all rows always editable. "textModelColumn: Column that holds the text to be displayed. "textEditableModelColumn: Column that defines whether or not the text is editable. TableModelColumnNeverEditable to make all rows never editable. TableModelColumnAlwaysEditable to make all rows always editable.

textParams:Text display settings, nil to use defaults.
Source   Edit  
proc addCheckItem(m: Menu; name: string;
                  onclicked: proc (sender: MenuItem; window: Window) = nil): MenuItem {.
    discardable, ...raises: [], tags: [], forbids: [].}
Appends a generic menu item with a checkbox.
m:Menu instance.
name:Menu item text.
onclicked:Callback for when the menu item is clicked.
Source   Edit  
proc addImageColumn(table: Table; title: string; index: int) {....raises: [],
    tags: [], forbids: [].}

Appends an image column to the table.

Images are drawn at icon size, using the representation that best fits the pixel density of the screen.

table:Table instance.
title:Column title text.
index:Column that holds the images to be displayed.
Source   Edit  
proc addImageTextColumn(t: Table; name: string;
                        imageIndex, textIndex, editableMode: int;
                        textParams: ptr TableTextColumnOptionalParams) {.
    ...raises: [], tags: [], forbids: [].}

Appends a column to the table that displays both an image and text.

Images are drawn at icon size, using the representation that best fits the pixel density of the screen.

t:Table instance.
name:Column title text.
imageIndex:Column that holds the images to be displayed.
textIndex:Column that holds the text to be displayed.
editableMode:Column that defines whether or not the text is editable. TableModelColumnNeverEditable to make all rows never editable. TableModelColumnAlwaysEditable to make all rows always editable.
textParams:Text display settings, NULL to use defaults.
Source   Edit  
proc addItem(m: Menu; name: string;
             onclicked: proc (sender: MenuItem; window: Window) = nil): MenuItem {.
    discardable, ...raises: [], tags: [], forbids: [].}
Appends a generic menu item.
m:Menu instance.
name:Menu item text.
onclicked:Callback for when the menu item is clicked.
Source   Edit  
proc addPreferencesItem(m: Menu; onclicked: proc (sender: MenuItem;
    window: Window) = nil): MenuItem {.discardable, ...raises: [], tags: [],
                                       forbids: [].}
Appends a new Preferences menu item.
Warning: Only one such menu item may exist per application.
m:Menu instance.
onclicked:Callback for when the menu item is clicked.
Source   Edit  
proc addProgressBarColumn(table: Table; title: string; index: int) {....raises: [],
    tags: [], forbids: [].}

Appends a column to the table containing a progress bar.

The workings and valid range are exactly the same as that of uiProgressBar.

table:Table instance.
title:Column title text.
index:Column that holds the data to be displayed. Integer in range of [-1, 100], see ProgressBar for details.
Source   Edit  
proc addQuitItem(m: Menu; shouldQuit: proc (): bool): MenuItem {.discardable,
    ...raises: [], tags: [], forbids: [].}
Appends a new Quit menu item.
Warning: Only one such menu item may exist per application.
Error: the window MUST be destroyed in shouldQuit if the proc returns true
m:Menu instance
shouldQuit:Proc that returns if the application should quit or not
Source   Edit  
proc addRectangle(p: DrawPath; x, y, width, height: float) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc addSeparator(m: Menu) {....raises: [], tags: [], forbids: [].}
Appends a new separator.
m:Menu instance.
Source   Edit  
proc addTextColumn(t: Table; name: string;
                   textModelColumn, textEditableModelColumn: int;
                   textParams: ptr TableTextColumnOptionalParams = nil) {.
    ...raises: [], tags: [], forbids: [].}
Appends a text column to the table.
t:Table instance.
name:Column title text.
textModelColumn:Column that holds the text to be displayed.
textEditableModelColumn:Column that defines whether or not the text is editable. TableModelColumnNeverEditable to make all rows never editable. TableModelColumnAlwaysEditable to make all rows always editable.
textParams:Text display settings, nil to use defaults.
Source   Edit  
proc addUnattributed(s: AttributedString; str: string) {....raises: [], tags: [],
    forbids: [].}
Adds string str to the end of s. The new substring will be unattributed. Source   Edit  
proc addWithAttributes(s: AttributedString; str: string;
                       attrs: openArray[Attribute]) {....raises: [], tags: [],
    forbids: [].}
Adds string str to the end of s. The new substring will have the attributes attrs applied to it. Source   Edit  
proc addWithAttributes(s: AttributedString; str: string;
                       attrs: varargs[Attribute]) {....raises: [], tags: [],
    forbids: [].}
Adds string str to the end of s. The new substring will have the attributes attrs applied to it. Source   Edit  
proc arcTo(p: DrawPath; xCenter, yCenter, radius, startAngle, sweep: float;
           negative: int) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc beginUserWindowMove(a: Area) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc beginUserWindowResize(a: Area; edge: WindowResizeEdge) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc bezierTo(p: DrawPath; c1x, c1y, c2x, c2y, endX, endY: float) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc borderless(w: Window): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the window is borderless.
w:Window instance.
Source   Edit  
proc borderless=(w: Window; borderless: bool) {....raises: [], tags: [],
    forbids: [].}
Returns whether or not the window is full screen.
Note: This method is merely a hint and may be ignored by the system.
w:Window instance.
borderless:true to make window borderless, false otherwise.
Source   Edit  
proc byteIndexToGrapheme(s: AttributedString; pos: int): int {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc checked(c: Checkbox): bool {....raises: [], tags: [], forbids: [].}
Returns whether or the checkbox is checked.
c:Checkbox instance.
Source   Edit  
proc checked(m: MenuItem): bool {....raises: [], tags: [], forbids: [].}

Returns whether or not the menu item's checkbox is checked.

To be used only with items created via addCheckItem().

m:MenuItem instance.
Source   Edit  
proc checked=(c: Checkbox; checked: bool) {....raises: [], tags: [], forbids: [].}
Sets whether or not the checkbox is checked.
c:Checkbox instance.
checked:true to check box, false otherwise.
Source   Edit  
proc checked=(m: MenuItem; checked: bool) {....raises: [], tags: [], forbids: [].}

Sets whether or not the menu item's checkbox is checked.

To be used only with items created via addCheckItem().

m:MenuItem instance.
checked:true to check menu item checkbox, false otherwise.
Source   Edit  
proc child(g: Group): Widget {....raises: [], tags: [], forbids: [].}
Returns the group's child widget.
g:Group instance.
Source   Edit  
proc child(w: Window): Widget {....raises: [], tags: [], forbids: [].}
Returns the window's child.
w:Window instance.
Source   Edit  
proc child=(g: Group; c: Widget) {....raises: [], tags: [], forbids: [].}
Sets the group's child.
g:Group instance.
c:Widget child instance, or nil.
Source   Edit  
proc child=(w: Window; child: Widget) {....raises: [], tags: [], forbids: [].}
Sets the window's child.
w:Window instance.
child:Widget to be made child.
Source   Edit  
proc clear(c: Combobox) {....raises: [], tags: [], forbids: [].}
Deletes all items from the combo box.
c:Combobox instance.
Source   Edit  
proc clear(e: EditableCombobox) {....raises: [], tags: [], forbids: [].}
Clears the editable combobox's text
e:Combobox instance.
Source   Edit  
proc clear(e: Entry) {....raises: [], tags: [], forbids: [].}
Clears the entry's text
e:Entry instance.
Source   Edit  
proc clear(e: MultilineEntry) {....raises: [], tags: [], forbids: [].}
Clears the multi line entry's text
e:MultilineEntry instance.
Source   Edit  
proc clip(c: ptr DrawContext; path: DrawPath) {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc clone(otf: OpenTypeFeatures): OpenTypeFeatures {....raises: [], tags: [],
    forbids: [].}
Makes a copy of otf and returns it. Changing one will not affect the other. Source   Edit  
proc closeFigure(p: DrawPath) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc color(a: Attribute): tuple[r, g, b, alpha: float] {....raises: [], tags: [],
    forbids: [].}
Returns the text color stored in a.
Error: It is an error to call this on a Attribute that does not hold a text color.
Source   Edit  
proc color(c: ColorButton): tuple[r, g, b, a: float] {....raises: [], tags: [],
    forbids: [].}
Returns the color button color.
c:ColorButton instance
Source   Edit  
proc color(v: TableValue): tuple[r, g, b, a: float] {....raises: [ValueError],
    tags: [], forbids: [].}

Returns the color value held internally.

To be used only on TableValue objects of type TableValueTypeColor.

v:Table value.
Source   Edit  
proc color=(c: ColorButton; color: Color) {....raises: [], tags: [], forbids: [].}

Sets the color button color.

If you need to set color alpha use setColor()

c:ColorButton instance.
color:Color.
Source   Edit  
proc columnWidth(table: Table; column: int): int {....raises: [], tags: [],
    forbids: [].}
Returns the table column width in pixels.
table:Table instance.
column:Column index.
Source   Edit  
proc contentSize(window: Window): tuple[width, height: int] {....raises: [],
    tags: [], forbids: [].}
Gets the window content size.
Note: The content size does NOT include window decorations like menus or title bars.
window:Window instance.
Source   Edit  
proc contentSize=(window: Window; size: tuple[width, height: int]) {....raises: [],
    tags: [], forbids: [].}
Gets the window content size.
Note: The content size does NOT include window decorations like menus or title bars.
Note: This method is merely a hint and may be ignored by the system.
window:Window instance.
size.width:Window content width to set.
size.height:Window content height to set.
Source   Edit  
proc delete(b: Box; index: int) {....raises: [], tags: [], forbids: [].}
Removes the widget at index from the box.
Note: The widget is neither destroyed nor freed.
b:Box instance.
index:Index of widget to be removed.
Source   Edit  
proc delete(c: Combobox; index: int) {....raises: [], tags: [], forbids: [].}
Deletes an item at index from the combo box.
Note: Deleting the index of the item currently selected will move the selection to the next item in the combo box or -1 if no such item exists.
c:Combobox instance.
index:Index of the item to be deleted.
Source   Edit  
proc delete(f: Form; index: int) {....raises: [], tags: [], forbids: [].}
Removes the widget at index from the form.
Note: The widget is neither destroyed nor freed.
f:Form instance.
index:Index of the widget to be removed.
Source   Edit  
proc delete(s: AttributedString; start, end: int) {....raises: [], tags: [],
    forbids: [].}
Deletes the characters and attributes of s in the byte range [start, end). Source   Edit  
proc delete(t: Tab; index: int) {....raises: [], tags: [], forbids: [].}
Removes the widget at index.
Note: The widget is neither destroyed nor freed.
t:Tab instance.
index:Index at which to insert the widget.
Source   Edit  
proc destroy[SomeWidget: Widget](w: SomeWidget)

Dispose and free all allocated resources.

The platform specific APIs that actually destroy a Widget (and its children) are called.

Source   Edit  
proc disable(m: MenuItem) {....raises: [], tags: [], forbids: [].}

Disables the menu item.

Menu item is grayed out and user interaction is not possible.

m:MenuItem instance.
Source   Edit  
proc disable[SomeWidget: Widget and not MenuItem](w: SomeWidget)
Disables the widget. Source   Edit  
proc drawText(c: ptr DrawContext; tl: DrawTextLayout; point: tuple[x, y: float]) {.
    ...raises: [], tags: [], forbids: [].}
Draws tl in c with the top-left point of tl at (point.x, point.y). Source   Edit  
proc enable(m: MenuItem) {....raises: [], tags: [], forbids: [].}
Enables the menu item.
m:MenuItem instance.
Source   Edit  
proc enable[SomeWidget: Widget and not MenuItem](w: SomeWidget)
Enables the widget. Source   Edit  
proc enabled[SomeWidget: Widget](w: SomeWidget): bool
Returns whether or not the widget is enabled. Defaults to true. Source   Edit  
proc enabledToUser[SomeWidget: Widget](w: SomeWidget): bool

Returns whether or not the widget can be interacted with by the user.

Checks if the widget and all it's parents are enabled to make sure it can be interacted with by the user.

Source   Edit  
proc `end`(p: DrawPath) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc ended(p: DrawPath): bool {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc error(parent: Window; title, desc: string) {....raises: [], tags: [],
    forbids: [].}
Alias for msgBoxError Source   Edit  
proc extents(tl: DrawTextLayout): tuple[width, height: float] {....raises: [],
    tags: [], forbids: [].}
Returns the width and height of tl. The returned width may be smaller than the width passed into newDrawTextLayout() depending on how the text in tl is wrapped. Therefore, you can use this function to get the actual size of the text layout. Source   Edit  
proc family(a: Attribute): string {....raises: [], tags: [], forbids: [].}
Returns the font family stored in a.
Error: It is an error to call this on a Attribute that does not hold a font family.
Source   Edit  
proc features(a: Attribute): OpenTypeFeatures {....raises: [], tags: [],
    forbids: [].}
Returns the OpenType features stored in a.
Error: It is an error to call this on a Attribute that does not hold OpenType features.
Source   Edit  
proc fill(c: ptr DrawContext; path: DrawPath; b: ptr DrawBrush) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc focused(w: Window): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the window is focused.
w:Window instance.
Source   Edit  
proc font(f: FontButton): FontDescriptor {....raises: [], tags: [], forbids: [].}
Returns the selected font.
f:FontButton instance
Source   Edit  
proc forEach(otf: OpenTypeFeatures;
             f: proc (otf: OpenTypeFeatures; abcd: string; value: int): ForEach) {.
    ...raises: [], tags: [], forbids: [].}
Executes f for every tag-value pair in otf. The enumeration order is unspecified.
Error: You cannot modify otf while this function is running.
Source   Edit  
proc forEachAttribute(str: AttributedString; fun: proc (s: AttributedString;
    a: Attribute; start, end: int): ForEach) {....raises: [], tags: [], forbids: [].}
enumerates all the Attributes in str. Within fun, str still owns the attribute; you can neither free it nor save it for later use.
Error: You cannot modify str in fun.
Source   Edit  
proc free(a: Attribute) {....raises: [], tags: [], forbids: [].}
Frees a Attribute. You generally do not need to call this yourself, as AttributedString does this for you.
Error: It is an error to call this function on a Attribute that has been given to a AttributedString.

You can call this, however, if you created a Attribute that you aren't going to use later.

Source   Edit  
proc free(a: AttributedString) {....raises: [], tags: [], forbids: [].}
Destroys the AttributedString a. It will also free all Attributes within. Source   Edit  
proc free(f: ptr FontDescriptor) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc free(i: Image) {....raises: [], tags: [], forbids: [].}
Frees the image container and all associated resources.
i:Image instance.
Source   Edit  
proc free(otf: OpenTypeFeatures) {....raises: [], tags: [], forbids: [].}
Frees otf Source   Edit  
proc free(p: DrawPath) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc free(str: string) {....raises: [], tags: [], forbids: [].}

Free the memory of a returned string.

Every time a string is returned from libui, this method should be called.

Source   Edit  
proc free(t: ptr TableSelection) {....raises: [], tags: [], forbids: [].}
Frees the given TableSelection and all its resources.
s:TableSelection instance.
Source   Edit  
proc free(t: TableModel) {....raises: [], tags: [], forbids: [].}
Frees the table model.
Error: It is an error to free table models currently associated with a Table.
m:Table model to free.
Source   Edit  
proc free(t: TableValue) {....raises: [], tags: [], forbids: [].}
Frees the TableValue.
Warning:

This function is to be used only on TableValue objects that have NOT been passed to Table or TableModel - as these take ownership of the object.

Use this for freeing erroneously created values or when directly calling TableModelHandler without transferring ownership to Table or TableModel.

t:TableValue to free.
Source   Edit  
proc free(tl: DrawTextLayout) {....raises: [], tags: [], forbids: [].}
Frees tl. The underlying AttributedString is not freed. Source   Edit  
proc free[SomeWidget: Widget](w: SomeWidget)
Frees the memory associated with the widget reference.
Note: This method is public only for writing custom widgets.
Source   Edit  
proc freeFont(desc: ptr FontDescriptor) {....raises: [], tags: [], forbids: [].}

Frees a FontDescriptor previously filled by font().

After calling this function the contents of desc should be assumed undefined, however you can safely reuse desc.

Calling this function on a FontDescriptor not previously filled by font() results in undefined behavior.

desc:Font descriptor to free.
Source   Edit  
proc fullscreen(w: Window): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the window is full screen.
w:Window instance.
Source   Edit  
proc fullscreen=(w: Window; fullscreen: bool) {....raises: [], tags: [],
    forbids: [].}
Returns whether or not the window is full screen.
Note: This method is merely a hint and may be ignored by the system.
w:Window instance.
fullscreen:true to make window full screen, false otherwise.
Source   Edit  
proc get(otf: OpenTypeFeatures; a, b, c, d: char; value: var int): bool {.
    ...raises: [], tags: [], forbids: [].}

Determines whether the given feature tag is present in otf. If it is, value is set to the tag's value and true is returned. Otherwise, false is returned.

Note that if this function returns false, value isn't changed. This is important: if a feature is not present in a OpenTypeFeatures, the feature is NOT treated as if its value was zero anyway. Script-specific font shaping rules and font-specific feature settings may use a different default value for a feature. You should likewise not treat a missing feature as having a value of zero either. Instead, a missing feature should be treated as having some unspecified default value.

Source   Edit  
proc get(otf: OpenTypeFeatures; abcd: string; value: var int): bool {.
    ...raises: [ValueError], tags: [], forbids: [].}
Alias of get. a, b, c, and d are instead a string of 4 characters, each character representing a, b, c, and d respectively. Source   Edit  
proc getInt(v: TableValue): int {....raises: [ValueError], tags: [], forbids: [].}

Returns the integer value held internally.

To be used only on TableValue objects of type TableValueTypeInt.

v:Table value.
Source   Edit  
proc getType(a: Attribute): AttributeType {....raises: [], tags: [], forbids: [].}
Returns the AttributeType of a. Source   Edit  
proc graphemeToByteIndex(s: AttributedString; pos: int): int {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc handle[SomeWidget: Widget](w: SomeWidget): int
Returns the widget's OS-level handle.
w:Widget instance.
Source   Edit  
proc handler(a: Area): ptr AreaHandler {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc hasToolTip(s: Slider): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the slider has a tool tip.
s:Slider instance.
Source   Edit  
proc hasToolTip=(s: Slider; hasToolTip: bool) {....raises: [], tags: [],
    forbids: [].}
Sets whether or not the slider has a tool tip.
s:Slider instance.
hasToolTip:true to display a tool tip, false to display no tool tip.
Source   Edit  
proc headerVisible(t: Table): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the table header is visible.
table:Table instance.
Source   Edit  
proc headerVisible=(t: Table; visible: bool) {....raises: [], tags: [], forbids: [].}
Sets whether or not the table header is visible.
table:Table instance.
visible:true to show header, false to hide header.
Source   Edit  
proc hide[SomeWidget: Widget](w: SomeWidget)
Hides the widget. Source   Edit  
proc image(v: TableValue): Image {....raises: [ValueError], tags: [], forbids: [].}

Returns the image contained.

To be used only on TableValue objects of kind TableValueTypeImage.

Warning: The image returned is not owned by the object v, hence no lifetime guarantees can be made.
v:Table value.
Source   Edit  
func impl(b: Area): RawArea {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Attribute): RawAttribute {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: AttributedString): RawAttributedString {....raises: [], tags: [],
    forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Box): RawBox {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Button): RawButton {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Checkbox): RawCheckbox {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: ColorButton): RawColorButton {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Combobox): RawCombobox {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: DateTimePicker): RawDateTimePicker {....raises: [], tags: [],
    forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: DrawPath): RawDrawPath {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: DrawTextLayout): RawDrawTextLayout {....raises: [], tags: [],
    forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: EditableCombobox): RawEditableCombobox {....raises: [], tags: [],
    forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Entry): RawEntry {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: FontButton): RawFontButton {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Form): RawForm {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Grid): RawGrid {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Group): RawGroup {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Image): RawImage {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Label): RawLabel {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Menu): RawMenu {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: MenuItem): RawMenuItem {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: MultilineEntry): RawMultilineEntry {....raises: [], tags: [],
    forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: OpenTypeFeatures): RawOpenTypeFeatures {....raises: [], tags: [],
    forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: ProgressBar): RawProgressBar {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: RadioButtons): RawRadioButtons {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Separator): RawSeparator {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Slider): RawSlider {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Spinbox): RawSpinbox {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Tab): RawTab {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Table): RawTable {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: TableModel): RawTableModel {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: TableValue): RawTableValue {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(b: Window): RawWindow {....raises: [], tags: [], forbids: [].}
Gets internal implementation of b Source   Edit  
func impl(w: Widget): ptr [Control] {....raises: [], tags: [], forbids: [].}
Default internal implementation of Widgets Source   Edit  
func impl=(b: Area; r: RawArea) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Attribute; r: RawAttribute) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: AttributedString; r: RawAttributedString) {....raises: [], tags: [],
    forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Box; r: RawBox) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Button; r: RawButton) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Checkbox; r: RawCheckbox) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: ColorButton; r: RawColorButton) {....raises: [], tags: [],
    forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Combobox; r: RawCombobox) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: DateTimePicker; r: RawDateTimePicker) {....raises: [], tags: [],
    forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: DrawPath; r: RawDrawPath) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: DrawTextLayout; r: RawDrawTextLayout) {....raises: [], tags: [],
    forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: EditableCombobox; r: RawEditableCombobox) {....raises: [], tags: [],
    forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Entry; r: RawEntry) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: FontButton; r: RawFontButton) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Form; r: RawForm) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Grid; r: RawGrid) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Group; r: RawGroup) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Image; r: RawImage) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Label; r: RawLabel) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Menu; r: RawMenu) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: MenuItem; r: RawMenuItem) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: MultilineEntry; r: RawMultilineEntry) {....raises: [], tags: [],
    forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: OpenTypeFeatures; r: RawOpenTypeFeatures) {....raises: [], tags: [],
    forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: ProgressBar; r: RawProgressBar) {....raises: [], tags: [],
    forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: RadioButtons; r: RawRadioButtons) {....raises: [], tags: [],
    forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Separator; r: RawSeparator) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Slider; r: RawSlider) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Spinbox; r: RawSpinbox) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Tab; r: RawTab) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Table; r: RawTable) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: TableModel; r: RawTableModel) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: TableValue; r: RawTableValue) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
func impl=(b: Window; r: RawWindow) {....raises: [], tags: [], forbids: [].}
Sets internal implementation of b Source   Edit  
proc init() {....raises: [ValueError], tags: [], forbids: [].}
Initialize the application Source   Edit  
proc insertAt(c: Combobox; index: int; text: string) {....raises: [], tags: [],
    forbids: [].}
Inserts an item at index to the combo box.
c:Combobox instance.
index:Index at which to insert the item.
text:Item text.
Source   Edit  
proc insertAt(g: Grid; w, existing: Widget; at: At;
              left, top, xspan, yspan: int; hexpand: bool; halign: Align;
              vexpand: bool; valign: Align) {....raises: [], tags: [], forbids: [].}
Inserts a widget positioned in relation to another widget within the grid.
g:Grid instance.
w:The widget to insert.
existing:The existing widget to position relatively to.
at:Placement specifier in relation to existing widget.
xspan:Number of columns to span. Integer in range of [0, INT_MAX].
yspan:Number of rows to span. Integer in range of [0, INT_MAX].
hexpand:true to expand reserved area horizontally, false otherwise.
halign:Horizontal alignment of the widget within the reserved space.
vexpand:true to expand reserved area vertically, false otherwise.
valign:Vertical alignment of the widget within the reserved space.
Source   Edit  
proc insertAt(t: Tab; name: string; index: int; w: Widget) {....raises: [],
    tags: [], forbids: [].}
Inserts a widget in form of a page/tab with label at index.
t:Tab instance.
name:Label text.
index:Index at which to insert the widget.
w:Widget to append.
Source   Edit  
proc insertAtUnattributed(s: AttributedString; str: string; at: int) {.
    ...raises: [], tags: [], forbids: [].}
Adds the string str to s at the byte position specified by at. The new substring will be unattributed; existing attributes will be moved along with their text. Source   Edit  
proc invert(m: ptr DrawMatrix): int {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc invertible(m: ptr DrawMatrix): bool {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc italic(a: Attribute): TextItalic {....raises: [], tags: [], forbids: [].}
Returns the font italic mode stored in a.
Error: It is an error to call this on a Attribute that does not hold a font italic mode.
Source   Edit  
proc len(s: AttributedString): int {....raises: [], tags: [], forbids: [].}
Returns the number of UTF-8 bytes in the textual content of s Source   Edit  
proc lineTo(p: DrawPath; x, y: float) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc loadControlFont(f: ptr FontDescriptor) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc mainLoop() {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc mainStep(wait: int): bool {.discardable, ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc mainSteps() {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc margined(g: Group): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the group has a margin.
g:Group instance.
Source   Edit  
proc margined(t: Tab; index: int): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the page/tab at index has a margin.
t:Tab instance.
index:Index to check if it has a margin.
Source   Edit  
proc margined(w: Window): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the window has a margin.
w:Window instance.
Source   Edit  
proc margined=(g: Group; margined: bool) {....raises: [], tags: [], forbids: [].}

Sets whether or not the group has a margin.

The margin size is determined by the OS defaults.

g:Group instance.
margined:true to set a margin, false otherwise.
Source   Edit  
proc margined=(w: Window; margined: bool) {....raises: [], tags: [], forbids: [].}
Sets whether or not the window has a margin. The margin size is determined by the OS defaults.
w:Window instance.
margined:true to set a window margin, false otherwise.
Source   Edit  
proc msgBox(parent: Window; title, desc: string) {....raises: [], tags: [],
    forbids: [].}

Message box dialog window.

A message box displayed in a new window indicating a common message.

parent:Parent window.
title:Dialog window title text.
description:Dialog message text.
Source   Edit  
proc msgBoxError(parent: Window; title, desc: string) {....raises: [], tags: [],
    forbids: [].}

Error message box dialog window.

A message box displayed in a new window indicating an error. On some systems this may invoke an accompanying sound.

parent:Parent window.
title:Dialog window title text.
description:Dialog message text.
Source   Edit  
proc multiply(dest, src: ptr DrawMatrix) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc newArea(ah: ptr AreaHandler): Area {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc newAttributedString(initialString: string): AttributedString {....raises: [],
    tags: [], forbids: [].}
Creates a new AttributedString from initialString. The returned string will be entirely unattributed. Source   Edit  
proc newBackgroundColorAttribute(color: Color; a: float = 1.0): Attribute {.
    ...raises: [], tags: [], forbids: [].}
Creates a new Attribute that changes the background color of the text it is applied to.
Error: It is an error to specify an invalid color.
Source   Edit  
proc newBackgroundColorAttribute(r, g, b: float; a: float = 1.0): Attribute {.
    ...raises: [], tags: [], forbids: [].}
Creates a new Attribute that changes the background color of the text it is applied to.
Error: It is an error to specify an invalid color.
Source   Edit  
proc newButton(text: string; onclick: proc (sender: Button) = nil): Button {.
    ...raises: [], tags: [], forbids: [].}
Creates and returns a new button.
text:Button label text
onclick:callback for when the button is clicked.
Source   Edit  
proc newCheckbox(text: string; ontoggled: proc (sender: Checkbox) = nil): Checkbox {.
    ...raises: [], tags: [], forbids: [].}
Creates and returns a new checkbox.
text:Checkbox label text
ontoggled:Callback for when the checkbox is toggled by the user.
Source   Edit  
proc newColorAttribute(color: Color; a: float = 1.0): Attribute {....raises: [],
    tags: [], forbids: [].}
Creates a new Attribute that changes the color of the text it is applied to.
Error: It is an error to specify an invalid color.
Source   Edit  
proc newColorAttribute(r, g, b: float; a = 1.0): Attribute {....raises: [],
    tags: [], forbids: [].}
Creates a new Attribute that changes the color of the text it is applied to.
Error: It is an error to specify an invalid color.
Source   Edit  
proc newColorButton(color: Color; onchanged: proc (sender: ColorButton) = nil): ColorButton {.
    ...raises: [], tags: [], forbids: [].}
Creates a new color button.
color:ColorButton Color.
onchanged:Callback for when the color is changed.
Source   Edit  
proc newColorButton(onchanged: proc (sender: ColorButton) = nil): ColorButton {.
    ...raises: [], tags: [], forbids: [].}
Creates a new color button.
onchanged:Callback for when the color is changed.
Source   Edit  
proc newColorButton(r, g, b: 0.0 .. 1.0; alpha = 1.0;
                    onchanged: proc (sender: ColorButton) = nil): ColorButton {.
    ...raises: [], tags: [], forbids: [].}
Creates a new color button.
r:Red. Float in range of 0.0, 1.0.
g:Green. Float in range of 0.0, 1.0.
b:Blue. Float in range of 0.0, 1.0.
alpha:Alpha. Float in range of 0.0, 1.0.
onchanged:Callback for when the color is changed.
Source   Edit  
proc newCombobox(items: openArray[string] = [];
                 onselected: proc (sender: Combobox) = nil): Combobox {.
    ...raises: [], tags: [], forbids: [].}
Creates a new combo box.
items:List of strings to add to the combobox
onselected:Callback for when a combo box item is selected.
Source   Edit  
proc newDatePicker(date: DateTime;
                   onchanged: proc (sender: DateTimePicker) = nil): DateTimePicker {.
    ...raises: [], tags: [], forbids: [].}
Creates a new date picker
date:Date and/or time as local time.
onchanged:Callback for when the date time picker value is changed by the user.
Source   Edit  
proc newDatePicker(onchanged: proc (sender: DateTimePicker) = nil): DateTimePicker {.
    ...raises: [], tags: [], forbids: [].}
Creates a new date picker
onchanged:Callback for when the date time picker value is changed by the user.
Source   Edit  
proc newDateTimePicker(dateTime: DateTime;
                       onchanged: proc (sender: DateTimePicker) = nil): DateTimePicker {.
    ...raises: [], tags: [], forbids: [].}
Creates a new date and time picker.
dateTime:Date and/or time as local time.
onchanged:Callback for when the date time picker value is changed by the user.
Source   Edit  
proc newDateTimePicker(onchanged: proc (sender: DateTimePicker) = nil): DateTimePicker {.
    ...raises: [], tags: [], forbids: [].}
Creates a new date and time picker.
onchanged:Callback for when the date time picker value is changed by the user.
Source   Edit  
proc newDrawPath(fillMode: DrawFillMode): DrawPath {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc newDrawTextLayout(params: ptr DrawTextLayoutParams): DrawTextLayout {.
    ...raises: [], tags: [], forbids: [].}
Creates a new DrawTextLayout from the given parameters params. Source   Edit  
proc newEditableCombobox(items: openArray[string] = [];
                         onchanged: proc (sender: EditableCombobox) = nil): EditableCombobox {.
    ...raises: [], tags: [], forbids: [].}
Creates a new editable combo box.
onchanged:Callback for when an editable combo box item is selected or user text changed.
Source   Edit  
proc newEntry(text: string = ""; onchanged: proc (sender: Entry) = nil): Entry {.
    ...raises: [], tags: [], forbids: [].}
Creates a new entry.
text:Entry text
onchanged:Callback for when the user changes the entry's text.
Source   Edit  
proc newFamilyAttribute(family: string): Attribute {....raises: [], tags: [],
    forbids: [].}
Creates a new Attribute that changes the font family of the text it is applied to. Font family names are case-insensitive. Source   Edit  
proc newFeaturesAttribute(otf: OpenTypeFeatures): Attribute {....raises: [],
    tags: [], forbids: [].}
Creates a and returns new Attribute that changes the font family of the text it is applied to. otf is copied; you may free it after this function returns. Source   Edit  
proc newFigure(p: DrawPath; x: float; y: float) {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc newFigureWithArc(p: DrawPath;
                      xCenter, yCenter, radius, startAngle, sweep: float;
                      negative: int) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc newFontButton(onchanged: proc (sender: FontButton) = nil): FontButton {.
    ...raises: [], tags: [], forbids: [].}

Creates and returns a new font button.

The default font is determined by the OS defaults.

onchanged:Callback for when the font is changed.
Source   Edit  
proc newForm(padded: bool = false): Form {....raises: [], tags: [], forbids: [].}
Creates a new form.
padded:true to make widgets padded, false otherwise.
Source   Edit  
proc newGrid(padded: bool = false): Grid {....raises: [], tags: [], forbids: [].}
Creates a new grid.
padded:true to make widgets padded, false otherwise.
Source   Edit  
proc newGroup(title: string; margined: bool = false): Group {....raises: [],
    tags: [], forbids: [].}
Creates a new group
title:Group title text.
margined:Sets whether or not the group has a margin.
Source   Edit  
proc newHorizontalBox(padded = false): Box {....raises: [], tags: [], forbids: [].}

Creates and returns a new horizontal box.

Widgets within the box are placed next to each other horizontally.

padded:true to make widgets padded, false otherwise.
Source   Edit  
proc newHorizontalSeparator(): Separator {....raises: [], tags: [], forbids: [].}
Creates a new horizontal separator to separate controls being stacked vertically. Source   Edit  
proc newImage(width, height: float): Image {....raises: [], tags: [], forbids: [].}

Creates a new image container.

Dimensions are measured in points. This is most commonly the pixel size of the 1x scaled image.

width:Width in points.
height:Height in points.
Source   Edit  
proc newItalicAttribute(italic: TextItalic): Attribute {....raises: [], tags: [],
    forbids: [].}
Creates a new Attribute that changes the italic mode of the text it is applied to. Source   Edit  
proc newLabel(text: string = ""): Label {....raises: [], tags: [], forbids: [].}
Creates a new label.
text:Label text.
Source   Edit  
proc newMenu(name: string): Menu {....raises: [], tags: [], forbids: [].}
Creates a new menu.
Important: To add a menu and its items to a window, they must be created before calling newWindow()

Typical values are File, Edit, Help, etc.

name:Menu label.
Source   Edit  
proc newMultilineEntry(onchanged: proc (sender: MultilineEntry) = nil): MultilineEntry {.
    ...raises: [], tags: [], forbids: [].}
Creates a new multi line entry that visually wraps text when lines overflow. Source   Edit  
proc newNonWrappingMultilineEntry(onchanged: proc (sender: MultilineEntry) = nil): MultilineEntry {.
    ...raises: [], tags: [], forbids: [].}
Creates a new multi line entry that scrolls horizontally when lines overflow.
Note: Windows does not allow for this style to be changed after creation, hence the two constructors.
Source   Edit  
proc newOpenTypeFeatures(): OpenTypeFeatures {....raises: [], tags: [], forbids: [].}
Returns a new OpenTypeFeatures instance, with no tags yet added. Source   Edit  
proc newPasswordEntry(text: string = ""; onchanged: proc (sender: Entry) = nil): Entry {.
    ...raises: [], tags: [], forbids: [].}

Creates a new entry suitable for sensitive inputs like passwords.

The entered text is NOT readable by the user but masked as *******.

text:Entry text
onchanged:Callback for when the user changes the entry's text.
Source   Edit  
proc newProgressBar(indeterminate: bool = false): ProgressBar {....raises: [],
    tags: [], forbids: [].}
Creates a new progress bar.
indeterminate:Whether or not the progress bar will display an indeterminate value.
Source   Edit  
proc newRadioButtons(items: openArray[string] = [];
                     onselected: proc (sender: RadioButtons) = nil): RadioButtons {.
    ...raises: [], tags: [], forbids: [].}
Creates a new radio buttons instance.
onselected:Callback for when radio button is selected.
Source   Edit  
proc newScrollingArea(ah: ptr AreaHandler; width, height: int): Area {.
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc newSearchEntry(text: string = ""; onchanged: proc (sender: Entry) = nil): Entry {.
    ...raises: [], tags: [], forbids: [].}

Creates a new entry suitable for search.

Some systems will deliberately delay the onchanged() callback for a more natural feel.

text:Entry text
onchanged:Callback for when the user changes the entry's text.
Source   Edit  
proc newSizeAttribute(size: float): Attribute {....raises: [], tags: [],
    forbids: [].}
Creates a new Attribute that changes the size of the text it is applied to, in typographical points. Source   Edit  
proc newSlider(min, max: int; onchanged: proc (sender: Slider) = nil): Slider {.
    ...deprecated: "Use `newSlider(min..max, ...)` instead.", raises: [], tags: [],
    forbids: [].}
Deprecated: Use `newSlider(min..max, ...)` instead.

Creates a new slider.

The initial slider value equals the minimum value.

In the current implementation min and max are swapped if min > max. This may change in the future though.

min:Minimum value
max:Maximum value
onchanged:Callback for when the slider value is changed by the user.
Source   Edit  
proc newSlider(range: Slice[SomeInteger]; onchanged: proc (sender: Slider) = nil): Slider

Creates a new slider.

The initial slider value equals the minimum value.

In the current implementation min and max are swapped if min > max. This may change in the future though.

range:Slider range, as min .. max
onchanged:Callback for when the slider value is changed by the user.
Source   Edit  
proc newSpinbox(min, max: int; onchanged: proc (sender: Spinbox) = nil): Spinbox {.
    ...deprecated: "Use `newSpinbox(min..max, ...)` instead", raises: [], tags: [],
    forbids: [].}
Deprecated: Use `newSpinbox(min..max, ...)` instead

Creates a new spinbox.

The initial spinbox value equals the minimum value.

In the current implementation min and max are swapped if min>max. This may change in the future though.

min:Minimum value.
max:Maximum value.
onchanged:Callback for when the spinbox value is changed by the user.
Source   Edit  
proc newSpinbox(range: Slice[SomeInteger];
                onchanged: proc (sender: Spinbox) = nil): Spinbox

Creates a new spinbox.

The initial spinbox value equals the minimum value.

In the current implementation min and max are swapped if min>max. This may change in the future though.

range:Range of allowed values as min..max.
onchanged:Callback for when the spinbox value is changed by the user.
Source   Edit  
proc newStretchAttribute(stretch: TextStretch): Attribute {....raises: [],
    tags: [], forbids: [].}
Creates a new Attribute that changes the stretch of the text it is applied to. Source   Edit  
proc newTab(): Tab {....raises: [], tags: [], forbids: [].}
Creates a new tab container. Source   Edit  
proc newTable(params: ptr TableParams): Table {....raises: [], tags: [],
    forbids: [].}
Creates a new table.
params:Table parameters.
Source   Edit  
proc newTableModel(mh: ptr TableModelHandler): TableModel {....raises: [],
    tags: [], forbids: [].}
Creates a new table model.
mh:Table model handler.
Source   Edit  
proc newTableValue(color: Color; a: 0.0 .. 1.0 = 1.0): TableValue {....raises: [],
    tags: [], forbids: [].}
Creates a new table value to store a color in.
color:Table value color.
a:Alpha. Float in range of 0, 1.0.
Source   Edit  
proc newTableValue(i: int | bool): TableValue

Creates a new table value to store an integer.

This value type can be used in conjunction with properties like column editable `true`, `false` or widget like progress bars and checkboxes. For these, consult ProgressBar and Checkbox for the allowed integer ranges.

i:Integer or boolean value.
Source   Edit  
proc newTableValue(img: Image): TableValue {....raises: [], tags: [], forbids: [].}
Creates a new table value to store an image.
Warning: Unlike other TableValue constructors, this function does NOT copy the image to save time and space. Make sure the image data stays valid while in use by the library. As a general rule: if the constructor is called via the TableModelHandler, the image is safe to free once execution returns to ANY of your code.
img:Image. Data is NOT copied and needs to kept alive.
Source   Edit  
proc newTableValue(r, g, b: 0.0 .. 1.0; a = 1.0): TableValue {....raises: [],
    tags: [], forbids: [].}
Creates a new table value to store a color in.
r:Red. Float in range of 0, 1.0.
g:Green. Float in range of 0, 1.0.
b:Blue. Float in range of 0, 1.0.
a:Alpha. Float in range of 0, 1.0.
Source   Edit  
proc newTableValue(str: string): TableValue {....raises: [], tags: [], forbids: [].}
Creates a new TableValue to store a text string.
str:String value.
Source   Edit  
proc newTimePicker(onchanged: proc (sender: DateTimePicker) = nil): DateTimePicker {.
    ...raises: [], tags: [], forbids: [].}
Creates a new time picker.
onchanged:Callback for when the date time picker value is changed by the user.
Source   Edit  
proc newTimePicker(time: DateTime;
                   onchanged: proc (sender: DateTimePicker) = nil): DateTimePicker {.
    ...raises: [], tags: [], forbids: [].}
Creates a new time picker.
time:Date and/or time as local time.
onchanged:Callback for when the date time picker value is changed by the user.
Source   Edit  
proc newUnderlineAttribute(u: Underline): Attribute {....raises: [], tags: [],
    forbids: [].}
Creates a new Attribute that changes the type of underline on the text it is applied to. Source   Edit  
proc newUnderlineColorAttribute(u: UnderlineColor; color: Color; a: float = 0.0): Attribute {.
    ...raises: [], tags: [], forbids: [].}
Creates a new Attribute that changes the color of the underline on the text it is applied to.
Error: If the specified color type is UnderlineColorCustom, it is an error to specify an invalid color value. Otherwise, the color values are ignored and should be specified as zero.
Source   Edit  
proc newUnderlineColorAttribute(u: UnderlineColor; r = 0.0; g = 0.0; b = 0.0;
                                a: float = 0.0): Attribute {....raises: [],
    tags: [], forbids: [].}
Creates a new Attribute that changes the color of the underline on the text it is applied to.
Error: If the specified color type is UnderlineColorCustom, it is an error to specify an invalid color value. Otherwise, the color values are ignored and should be specified as zero.
Source   Edit  
proc newVerticalBox(padded = false): Box {....raises: [], tags: [], forbids: [].}

Creates a new vertical box.

Widgets within the box are placed next to each other vertically.

padded:true to make widgets padded, false otherwise.
Source   Edit  
proc newVerticalSeparator(): Separator {....raises: [], tags: [], forbids: [].}
Creates a new vertical separator to separate controls being stacked horizontally. Source   Edit  
proc newWeightAttribute(weight: TextWeight): Attribute {....raises: [], tags: [],
    forbids: [].}
Creates a new Attribute that changes the weight of the text it is applied to. Source   Edit  
proc newWindow(title: string; width, height: int; hasMenubar: bool = false;
               onfocuschanged: proc (sender: Window) = nil): Window {.
    ...raises: [], tags: [], forbids: [].}
Creates and returns a new Window.
title:Window title text.
width:Window width.
height:Window height.
hasMenubar:Whether or not the window should display a menu bar.
onfocuschanged:Callback for when the window focus changes.
Source   Edit  
proc numGraphemes(s: AttributedString): int {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc openFile(parent: Window): string {....raises: [], tags: [], forbids: [].}
File chooser dialog window to select a single file. Returns the selected file path
Note: File paths are separated by the underlying OS file path separator.
parent:Parent window.
Source   Edit  
proc openFolder(parent: Window): string {....raises: [], tags: [], forbids: [].}
Folder chooser dialog window to select a single file. Returns the selected folder path
Note: File paths are separated by the underlying OS file path separator.
parent:Parent window.
Source   Edit  
func osSignature[SomeWidget: Widget](w: SomeWidget): int
Get widget OS signature Source   Edit  
proc padded(b: Box): bool {....raises: [], tags: [], forbids: [].}

Returns whether or not widgets within the box are padded.

Padding is defined as space between individual widgets.

b:Box instance.
Source   Edit  
proc padded(f: Form): bool {....raises: [], tags: [], forbids: [].}

Returns whether or not widgets within the form are padded.

Padding is defined as space between individual widgets.

f:Form instance.
Source   Edit  
proc padded(g: Grid): bool {....raises: [], tags: [], forbids: [].}

Returns whether or not widgets within the grid are padded.

Padding is defined as space between individual widgets.

g:Grid instance.
Source   Edit  
proc padded=(b: Box; padded: bool) {....raises: [], tags: [], forbids: [].}

Sets whether or not widgets within the box are padded.

Padding is defined as space between individual widgets. The padding size is determined by the OS defaults.

b:Box instance.
padded:true to make widgets padded, false otherwise.
Source   Edit  
proc padded=(f: Form; padded: bool) {....raises: [], tags: [], forbids: [].}

Sets whether or not widgets within the box are padded.

Padding is defined as space between individual widgets. The padding size is determined by the OS defaults.

f:Form instance.
padded:true to make widgets padded, false otherwise.
Source   Edit  
proc padded=(g: Grid; padded: bool) {....raises: [], tags: [], forbids: [].}

Sets whether or not widgets within the grid are padded.

Padding is defined as space between individual widgets. The padding size is determined by the OS defaults.

g:Grid instance.
padded:true to make widgets padded, false otherwise.
Source   Edit  
proc parent[SomeWidget: Widget and not Window](w: SomeWidget): Widget
Returns the parent of w
Important: Returns nil if w has no parent
w:Widget instance.
Source   Edit  
proc parent=[SomeWidget: Widget](w: SomeWidget; parent: Widget)
Sets the widget's parent.
w:Widget instance.
parent:The parent Widget, nil to detach.
Source   Edit  
proc pollingMainLoop(poll: proc (timeout: int); timeout: int) {.
    ...raises: [Exception], tags: [RootEffect], forbids: [].}

Can be used to merge an async event loop with libui-ng's event loop.

Implemented using timeouts and polling because that's the only thing that truely composes.

Source   Edit  
proc position(w: Window): tuple[x, y: int] {....raises: [], tags: [], forbids: [].}

Gets the window position.

Coordinates are measured from the top left corner of the screen.

Note: This method may return inaccurate or dummy values on Unix platforms.
w:Window instance.
Source   Edit  
proc position=(w: Window; pos: tuple[x, y: int]) {....raises: [], tags: [],
    forbids: [].}

Moves the window to the specified position.

Coordinates are measured from the top left corner of the screen.

Note: This method may return inaccurate or dummy values on Unix platforms.
w:Window instance.
pos.x:New x position of the window.
pos.y:New y position of the window.
Source   Edit  
proc queueMain(f: proc (data: pointer) {.cdecl.}; data: pointer) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc queueRedrawAll(a: Area) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc quit() {....raises: [], tags: [], forbids: [].}
Quit the application Source   Edit  
proc quitAll(errorcode: int = QuitSuccess) {....raises: [], tags: [], forbids: [].}
Quit both UIng and the program altogether Source   Edit  
proc range=(s: Slider; sliderRange: Slice[SomeInteger])
Sets the slider range.
s:Slider instance.
sliderRange:Slider range, as min .. max
Source   Edit  
proc readOnly(e: Entry): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the entry's text can be changed.
e:Entry instance.
Source   Edit  
proc readOnly(e: MultilineEntry): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the multi line entry's text can be changed.
e:MultilineEntry instance
Source   Edit  
proc readOnly=(e: Entry; readOnly: bool) {....raises: [], tags: [], forbids: [].}
Sets whether or not the entry's text is read only.
e:Entry instance.
readonly:true to make read only, false otherwise.
Source   Edit  
proc readOnly=(e: MultilineEntry; readOnly: bool) {....raises: [], tags: [],
    forbids: [].}
Sets whether or not the multi line entry's text is read only.
e:MultilineEntry instance
readonly:true to make read only, false otherwise.
Source   Edit  
proc remove(otf: OpenTypeFeatures; a, b, c, d: char) {....raises: [], tags: [],
    forbids: [].}
Removes the given feature tag and value from otf. If the tag is not present in otf, this function does nothing. Source   Edit  
proc remove(otf: OpenTypeFeatures; abcd: string) {....raises: [ValueError],
    tags: [], forbids: [].}
Alias of remove. a, b, c, and d are instead a string of 4 characters, each character representing a, b, c, and d respectively. Source   Edit  
proc resizeable(w: Window): bool {....raises: [], tags: [], forbids: [].}
Returns whether or not the window is user resizeable.
w:Window instance.
Source   Edit  
proc resizeable=(w: Window; resizeable: bool) {....raises: [], tags: [],
    forbids: [].}
Sets whether or not the window is user resizeable.
Note: This method is merely a hint and may be ignored by the system.
w:Window instance.
resizeable:true to make window resizable, false otherwise.
Source   Edit  
proc restore(c: ptr DrawContext) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc rotate(m: ptr DrawMatrix; x, y, amount: float) {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc rowChanged(m: TableModel; index: int) {....raises: [], tags: [], forbids: [].}

Informs all associated Table views that a row has been changed.

You do NOT need to call this in your setCellValue() handlers, but NEED to call this if your data changes at any other point.

m:Table model that has changed.
index:Index of the row that has changed.
Source   Edit  
proc rowDeleted(m: TableModel; oldIndex: int) {....raises: [], tags: [],
    forbids: [].}

Informs all associated Table views that a row has been deleted.

You must delete the row from your model before you call this function.

numRows() must represent the new row count before you call this function.

m:Table model that has changed.
oldIndex:Index of the row that has been deleted.
Source   Edit  
proc rowInserted(m: TableModel; newIndex: int) {....raises: [], tags: [],
    forbids: [].}

Informs all associated Table views that a new row has been added.

You must insert the row data in your model before calling this function.

numRows() must represent the new row count before you call this function.

m:Table model that has changed.
newIndex:Index of the row that has been added.
Source   Edit  
proc save(c: ptr DrawContext) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc saveFile(parent: Window): string {....raises: [], tags: [], forbids: [].}

Save file dialog window. Returns the selected file path.

The user is asked to confirm overwriting existing files, should the chosen file path already exist on the system.

Note: File paths are separated by the underlying OS file path separator.
parent:Parent window.
Source   Edit  
proc scale(m: ptr DrawMatrix; xCenter, yCenter, x, y: float) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc scrollTo(a: Area; x, y, width, height: float) {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc selected(c: Combobox): int {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc selected(r: RadioButtons): int {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc selected=(c: Combobox; index: int) {....raises: [], tags: [], forbids: [].}
Sets the item selected.
c:Combobox instance.
index:Index of the item to be selected, -1 to clear selection.
Source   Edit  
proc selected=(r: RadioButtons; index: int) {....raises: [], tags: [], forbids: [].}
Sets the item selected.
r:RadioButtons instance.
index:Index of the item to be selected, -1 to clear selection.
Source   Edit  
proc selection(table: Table): seq[int] {....raises: [], tags: [], forbids: [].}
Returns the current table selection.
Note: For empty selections an empty seq will be returned.
table:Table instance.
Source   Edit  
proc selection=(table: Table; sel: openArray[int]) {....raises: [], tags: [],
    forbids: [].}
Sets the current table selection, clearing any previous selection.
Note: Selecting more rows than the selection mode allows for results in nothing happening.
table:Table instance.
sel:List of rows to select.
Source   Edit  
proc selectionMode(table: Table): TableSelectionMode {....raises: [], tags: [],
    forbids: [].}
Returns the table selection mode. Defaults to TableSelectionModeZeroOrOne
table:Table instance.
Source   Edit  
proc selectionMode=(table: Table; mode: TableSelectionMode) {....raises: [],
    tags: [], forbids: [].}
Sets the table selection mode.
Warning: All rows will be deselected if the existing selection is illegal in the new selection mode.
table:Table instance.
mode:Table selection mode to set.
Source   Edit  
proc setAllTabsMargined(t: Tab; margined: bool = true) {....raises: [], tags: [],
    forbids: [].}
Set all tabs in t as margined
t:Tab instance.
margined:true to set a margin for all tabs, false otherwise.
Source   Edit  
proc setAttribute(s: AttributedString; a: Attribute; start, end: int) {.
    ...raises: [], tags: [], forbids: [].}
Sets a in the byte range [start, end) of s. Any existing attributes in that byte range of the same type are removed. You should not use a after this function returns. Source   Edit  
proc setChild(w: Window; child: Widget) {....deprecated: "Use `child=` instead.",
    raises: [], tags: [], forbids: [].}
Deprecated: Use `child=` instead.
Sets the window's child.
w:Window instance.
child:Widget to be made child.
Source   Edit  
proc setColor(c: ColorButton; r, g, b: 0.0 .. 1.0; alpha: 0.0 .. 1.0 = 1.0) {.
    ...raises: [], tags: [], forbids: [].}
Sets the color button color.
c:ColorButton instance.
r:Red. Float in range of 0.0, 1.0.
g:Green. Float in range of 0.0, 1.0.
b:Blue. Float in range of 0.0, 1.0.
alpha:Alpha. Float in range of 0.0, 1.0.
Source   Edit  
proc setColumnWidth(table: Table; column, width: int) {....raises: [], tags: [],
    forbids: [].}

Sets the table column width.

Setting the width to -1 will restore automatic column sizing matching either the width of the content or column header (which ever one is bigger).

Note: Darwin currently only resizes to the column header width on -1.
table:Table instance.
column:Column index.
width:Column width to set in pixels, -1 to restore automatic column sizing.
Source   Edit  
proc setIdentity(m: ptr DrawMatrix) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc setMargined(t: Tab; index: int; margined: bool) {....raises: [], tags: [],
    forbids: [].}

Sets whether or not the page/tab at index has a margin.

The margin size is determined by the OS defaults.

t:Tab instance.
index:Index of the tab/page to un/set margin for.
margined:true to set a margin for tab at index, false otherwise.
Source   Edit  
proc setSortIndicator(table: Table; column: int; indicator: SortIndicator) {.
    ...raises: [], tags: [], forbids: [].}

Sets the column's sort indicator displayed in the table header.

Use this to display appropriate arrows in the table header to indicate a sort direction.

Note: Setting the indicator is purely visual and does not perform any sorting.
table:Table instance.
column:Column index.
indicator:Sort indicator.
Source   Edit  
proc show[SomeWidget: Widget](w: SomeWidget)
Shows the widget. Source   Edit  
func signature[SomeWidget: Widget](w: SomeWidget): int
Get widget signature Source   Edit  
proc size(a: Attribute): float {....raises: [], tags: [], forbids: [].}
Returns the font size stored in a.
Error: It is an error to call this on a Attribute that does not hold a font size.
Source   Edit  
proc size=(a: Area; size: tuple[width, height: int]) {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc skew(m: ptr DrawMatrix; x, y, xamount, yamount: float) {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc sortIndicator(table: Table; column: int): SortIndicator {....raises: [],
    tags: [], forbids: [].}
Returns the column's sort indicator displayed in the table header.
table:Table instance.
column:Column index.
Source   Edit  
proc stretch(a: Attribute): TextStretch {....raises: [], tags: [], forbids: [].}
Returns the font stretch stored in a.
Error: It is an error to call this on a Attribute that does not hold a font stretch.
Source   Edit  
proc stroke(c: ptr DrawContext; path: DrawPath; b: ptr DrawBrush;
            p: ptr DrawStrokeParams) {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc text(b: Button): string {....raises: [], tags: [], forbids: [].}
Returns the button label text. Source   Edit  
proc text(c: Checkbox): string {....raises: [], tags: [], forbids: [].}
Returns the checkbox label text.
c:Checkbox instance.
Source   Edit  
proc text(c: EditableCombobox): string {....raises: [], tags: [], forbids: [].}

Returns the text of the editable combo box.

This text is either the text of one of the predefined list items or the text manually entered by the user.

c:Combobox instance.
Source   Edit  
proc text(e: Entry): string {....raises: [], tags: [], forbids: [].}
Returns the entry's text.
e:Entry instance.
Source   Edit  
proc text(e: MultilineEntry): string {....raises: [], tags: [], forbids: [].}
Returns the multi line entry's text.
e:MultilineEntry instance
Source   Edit  
proc text(l: Label): string {....raises: [], tags: [], forbids: [].}
Returns the label text.
l:Lable Instance
Source   Edit  
proc text=(b: Button; text: string) {....raises: [], tags: [], forbids: [].}
Sets the button label text.
b:Button instance
text:Label text
Source   Edit  
proc text=(c: Checkbox; text: string) {....raises: [], tags: [], forbids: [].}
Sets the checkbox label text.
c:Checkbox instance.
text:Label text.
Source   Edit  
proc text=(c: EditableCombobox; text: string) {....raises: [], tags: [],
    forbids: [].}

Sets the text of the editable combo box.

This text is either the text of one of the predefined list items or the text manually entered by the user.

c:Combobox instance.
text:Text field text.
Source   Edit  
proc text=(e: Entry; text: string) {....raises: [], tags: [], forbids: [].}
Sets the entry's text.
e:Entry instance.
text:Entry text
Source   Edit  
proc text=(e: MultilineEntry; text: string) {....raises: [], tags: [], forbids: [].}
Sets the multi line entry's text.
e:MultilineEntry instance
text:Single/multi line text
Source   Edit  
proc text=(l: Label; text: string) {....raises: [], tags: [], forbids: [].}
Sets the label text.
l:Lable Instance
text:Label text.
Source   Edit  
proc time(d: DateTimePicker): DateTime {....raises: [], tags: [], forbids: [].}
Returns date and time stored in the data time picker.
d:DateTimePicker instance
Source   Edit  
proc time=(d: DateTimePicker; dateTime: DateTime) {....raises: [], tags: [],
    forbids: [].}
Sets date and time of the data time picker.
d:DateTimePicker instance.
time:Date and/or time as local time.
Source   Edit  
proc timer(milliseconds: int; fun: proc (): bool) {....raises: [], tags: [],
    forbids: [].}
Call fun after milliseconds milliseconds. This is repeated until fun returns false.
Note: This cannot be called from any thread, unlike queueMain()
Note: The minimum exact timing, either accuracy (timer burst, etc.) or granularity (15ms on Windows, etc.), is OS-defined
Source   Edit  
proc title(g: Group): string {....raises: [], tags: [], forbids: [].}
Returns the group title.
g:Group instance.
Source   Edit  
proc title(w: Window): string {....raises: [], tags: [], forbids: [].}
Returns the window title.
w:Window instance.
Source   Edit  
proc title=(g: Group; title: string) {....raises: [], tags: [], forbids: [].}
Sets the group title.
g:Group instance.
title:Group title text.
Source   Edit  
proc title=(w: Window; text: string) {....raises: [], tags: [], forbids: [].}
Returns the window title.
Note: This method is merely a hint and may be ignored on unix platforms.
w:Window instance.
title:Window title text.
Source   Edit  
proc topLevel[SomeWidget: Widget](w: SomeWidget): bool
Returns whether or not the widget is a top level widget. Source   Edit  
proc transform(c: ptr DrawContext; m: ptr DrawMatrix) {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc transformPoint(m: ptr DrawMatrix): tuple[x, y: float] {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc transformSize(m: ptr DrawMatrix): tuple[x, y: float] {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc translate(m: ptr DrawMatrix; x, y: float) {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc `type`(v: TableValue): TableValueType {....raises: [], tags: [], forbids: [].}
Gets the TableValue type.
v:Table value.
Source   Edit  
func typeSignature[SomeWidget: Widget](w: SomeWidget): int
Get widget type signature Source   Edit  
proc underline(a: Attribute): Underline {....raises: [], tags: [], forbids: [].}
Returns the underline type stored in a.
Error: It is an error to call this on a Attribute that does not hold an underline style.
Source   Edit  
proc underlineColor(a: Attribute): tuple[u: UnderlineColor,
    r, g, b, alpha: float] {....raises: [], tags: [], forbids: [].}
Returns the underline color stored in a.
Error: It is an error to call this on a Attribute that does not hold an underline color.
Source   Edit  
proc uninit() {....raises: [], tags: [], forbids: [].}

Un-Initialize the application

Usually not needed as mainLoop() calls this for you.

Source   Edit  
proc value(p: ProgressBar): int {....raises: [], tags: [], forbids: [].}
Returns the progress bar value.
p:ProgressBar instance.
Source   Edit  
proc value(s: Slider): int {....raises: [], tags: [], forbids: [].}
Returns the slider value.
s:Slider instance.
Source   Edit  
proc value(s: Spinbox): int {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc value=(p: ProgressBar; n: -1 .. 100) {....raises: [], tags: [], forbids: [].}

Sets the progress bar value.

Valid values are [0, 100] for displaying a solid bar imitating a percent value.

Use a value of -1 to render an animated bar to convey an indeterminate value.

p:ProgressBar instance.
n:Value to set. Integer in the range of [-1, 100].
Source   Edit  
proc value=(s: Slider; value: int) {....raises: [], tags: [], forbids: [].}
Sets the slider value.
s:Slider intance.
value:Value to set.
Source   Edit  
proc value=(s: Spinbox; value: int) {....raises: [], tags: [], forbids: [].}
Returns the spinbox value.
Note: Setting a value out of range will clamp to the nearest value in range.
s:Spinbox instance.
value:Value to set.
Source   Edit  
proc verifySetParent[SomeWidget: Widget](w: SomeWidget; parent: Widget)
Makes sure the widget's parent can be set to parent.
Warning: This will crash the application if false.
w:Widget instance.
parent:Widget instance.
Source   Edit  
proc visible[SomeWidget: Widget](w: SomeWidget): bool
Returns whether or not the widget is visible. Source   Edit  
proc weight(a: Attribute): TextWeight {....raises: [], tags: [], forbids: [].}
Returns the font weight stored in a.
Error: It is an error to call this on a Attribute that does not hold a font weight.
Source   Edit