mirror of
https://github.com/Airr/nim-cocoa.git
synced 2024-11-24 09:45:30 +00:00
21 lines
487 B
Nim
21 lines
487 B
Nim
{.compile: "widgets/button.m".}
|
|
|
|
import NSFunctions
|
|
|
|
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:
|
|
##
|
|
## .. code-block::nim
|
|
## btn1 = newButton(mainWindow, "Open", width-100, 20, 90, 24, btnClicked)
|
|
##
|
|
##
|
|
## Callback must be in the form:
|
|
##
|
|
## .. code-block::nim
|
|
## proc buttonCB(sender: ID) {.cdecl.} =
|
|
## <..code...>
|
|
##
|
|
|