sensitive: bool = true
sizeRequest: tuple[x, y: int] = (-1, -1)
tooltip: string = ""
margin: int
margin: Margin
renderable Window of BaseWidget
- All fields from BaseWidget
title: string
titlebar: Widget
defaultSize: tuple[width, height: int] = (800, 600)
child: Widget
Window:
Label(text = "Hello, world")
renderable Box of BaseWidget
- All fields from BaseWidget
orient: Orient
spacing: int
children: seq[BoxChild[Widget]]
style: set[BoxStyle]
- All adders from BaseWidget
add
expand = true
hAlign = AlignFill
vAlign = AlignFill
Box:
orient = OrientX
Label(text = "Label")
Button(text = "Button") {.expand: false.}
Box:
orient = OrientY
margin = 12
spacing = 6
for it in 0 ..< 5:
Label(text = "Label " & $it)
HeaderBar {.addTitlebar.}:
Box {.addLeft.}:
style = {BoxLinked}
for it in 0 ..< 5:
Button {.expand: false.}:
text = "Button " & $it
proc clicked() =
echo it
renderable Overlay of BaseWidget
- All fields from BaseWidget
child: Widget
overlays: seq[OverlayChild[Widget]]
- All adders from BaseWidget
add
addOverlay
hAlign = AlignFill
vAlign = AlignFill
renderable Label of BaseWidget
- All fields from BaseWidget
text: string
xAlign: float = 0.5
yAlign: float = 0.5
ellipsize: EllipsizeMode
wrap: bool = false
useMarkup: bool = false
style: set[LabelStyle]
Label:
text = "Hello, world!"
xAlign = 0.0
ellipsize = EllipsizeEnd
Label:
text = "Test ".repeat(50)
wrap = true
Label:
text = "<b>Bold</b>, <i>Italic</i>, <span font=\"20\">Font Size</span>"
useMarkup = true
renderable Icon of BaseWidget
- All fields from BaseWidget
name: string
pixelSize: int = -1
Icon:
name = "list-add-symbolic"
Icon:
name = "object-select-symbolic"
pixelSize = 100
renderable Button of BaseWidget
- All fields from BaseWidget
style: set[ButtonStyle]
child: Widget
shortcut: string
text: string
icon: string
Button:
icon = "list-add-symbolic"
style = {ButtonSuggested}
proc clicked() =
echo "clicked"
Button:
text = "Delete"
style = {ButtonDestructive}
Button:
text = "Inactive Button"
sensitive = false
Button:
text = "Copy"
shortcut = "<Ctrl>C"
proc clicked() =
app.writeClipboard("Hello, world!")
HeaderBar
renderable HeaderBar of BaseWidget
- All fields from BaseWidget
title: Widget
showTitleButtons: bool = true
left: seq[Widget]
right: seq[Widget]
- All adders from BaseWidget
addTitle
addLeft
addRight
Window:
title = "Title"
HeaderBar {.addTitlebar.}:
Button {.addLeft.}:
icon = "list-add-symbolic"
Button {.addRight.}:
icon = "open-menu-symbolic"
renderable ScrolledWindow of BaseWidget
renderable Entry of BaseWidget
- All fields from BaseWidget
text: string
placeholder: string
width: int = -1
maxWidth: int = -1
xAlign: float = 0.0
visibility: bool = true
invisibleChar: Rune = '*'.Rune
style: set[EntryStyle]
- changed:
proc (text: string)
- activate:
proc ()
Entry:
text = app.text
proc changed(text: string) =
app.text = text
Entry:
text = app.query
placeholder = "Search..."
proc changed(query: string) =
app.query = query
proc activate() =
## Runs when enter is pressed
echo app.query
Entry:
placeholder = "Password"
visibility = false
invisibleChar = '*'.Rune
renderable Paned of BaseWidget
- All fields from BaseWidget
orient: Orient
initialPosition: int
first: PanedChild[Widget]
second: PanedChild[Widget]
- All adders from BaseWidget
add
resize = true
shrink = false
Paned:
initialPosition = 200
Box(orient = OrientY) {.resize: false.}:
Label(text = "Sidebar")
Box(orient = OrientY) {.resize: true.}:
Label(text = "Content")
renderable CustomWidget of BaseWidget
- All fields from BaseWidget
focusable: bool
events: CustomWidgetEvents
- mousePressed:
proc (event: ButtonEvent): bool
- mouseReleased:
proc (event: ButtonEvent): bool
- mouseMoved:
proc (event: MotionEvent): bool
- scroll:
proc (event: ScrollEvent): bool
- keyPressed:
proc (event: KeyEvent): bool
- keyReleased:
proc (event: KeyEvent): bool
renderable DrawingArea of CustomWidget
- draw:
proc (ctx: CairoContext; size: (int, int)): bool
renderable GlArea of CustomWidget
- All fields from CustomWidget
useEs: bool = false
requiredVersion: tuple[major, minor: int] = (4, 3)
hasDepthBuffer: bool = true
hasStencilBuffer: bool = false
- setup:
proc (size: (int, int)): bool
- render:
proc (size: (int, int)): bool
renderable ColorButton of BaseWidget
- All fields from BaseWidget
color: tuple[r, g, b, a: float] = (0.0, 0.0, 0.0, 1.0)
useAlpha: bool = false
- changed:
proc (color: tuple[r, g, b, a: float])
renderable Switch of BaseWidget
- changed:
proc (state: bool)
Switch:
state = app.state
proc changed(state: bool) =
app.state = state
renderable ToggleButton of Button
- All fields from Button
state: bool
- changed:
proc (state: bool)
ToggleButton:
text = "Current State: " & $app.state
state = app.state
proc changed(state: bool) =
app.state = state
renderable LinkButton of Button
- All fields from Button
uri: string
visited: bool
renderable CheckButton of BaseWidget
- changed:
proc (state: bool)
CheckButton:
state = app.state
proc changed(state: bool) =
app.state = state
renderable Popover of BaseWidget
PopoverMenu
renderable PopoverMenu of BaseWidget
- All fields from BaseWidget
pages: Table[string, Widget]
MenuButton
renderable MenuButton of BaseWidget
- All fields from BaseWidget
child: Widget
popover: Widget
style: set[ButtonStyle]
text: string
icon: string
renderable ModelButton of BaseWidget
- All fields from BaseWidget
text: string
icon: string
menuName: string
renderable Separator of BaseWidget
renderable TextView of BaseWidget
- All fields from BaseWidget
buffer: TextBuffer
monospace: bool = false
cursorVisible: bool = true
editable: bool = true
acceptsTab: bool = true
indent: int = 0
renderable ListBoxRow of BaseWidget
ListBox:
for it in 0 ..< 10:
ListBoxRow {.addRow.}:
proc activate() =
echo it
Label(text = $it)
renderable ListBox of BaseWidget
- All fields from BaseWidget
rows: seq[Widget]
selectionMode: SelectionMode
selected: HashSet[int]
- select:
proc (rows: HashSet[int])
ListBox:
for it in 0 ..< 10:
Label(text = $it)
renderable FlowBoxChild of BaseWidget
FlowBox:
columns = 1 .. 5
for it in 0 ..< 10:
FlowBoxChild {.addChild.}:
Label(text = $it)
renderable FlowBox of BaseWidget
- All fields from BaseWidget
homogeneous: bool
rowSpacing: int
columnSpacing: int
columns: HSlice[int, int] = 1 .. 5
selectionMode: SelectionMode
children: seq[Widget]
FlowBox:
columns = 1 .. 5
for it in 0 ..< 10:
Label(text = $it)
renderable Frame of BaseWidget
- All fields from BaseWidget
label: string
align: tuple[x, y: float] = (0.0, 0.0)
child: Widget
Frame:
label = "Frame Title"
align = (0.2, 0.0)
Label:
text = "Content"
text: string
response: DialogResponse
style: set[ButtonStyle]
renderable Dialog of Window
- All fields from Window
buttons: seq[DialogButton]
- All adders from Window
addButton
title: string
buttons: seq[DialogButton]
renderable FileChooserDialog of BuiltinDialog
- All fields from BuiltinDialog
action: FileChooserAction
filename: string
renderable ColorChooserDialog of BuiltinDialog
- All fields from BuiltinDialog
color: tuple[r, g, b, a: float] = (0.0, 0.0, 0.0, 1.0)
useAlpha: bool = false
renderable MessageDialog of BuiltinDialog
renderable AboutDialog of BaseWidget
- All fields from BaseWidget
programName: string
logo: string
copyright: string
version: string
license: string
credits: seq[(string, seq[string])]