nim-cocoa/doc/NSButton.md
2021-07-29 21:32:20 -04:00

462 B

Imports

  • NSFunctions

Procs

newButton*

proc newButton*(parent: ID; caption: cstring; left: cint; top: cint; width: cint; height: cint; `func`: ACTION): ID  {.cdecl, importc: "createButton".}

Creates new Button object

Example:

  btn1 = newButton(mainWindow, "Open", width-100, 20, 90, 24, btnClicked)

Callback must be in the form:

  proc buttonCB(sender: ID) {.cdecl.} =
    <..code...>