Skip to content

Instantly share code, notes, and snippets.

@zacharycarter
Created December 8, 2018 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zacharycarter/e14e647ab6cb818675326d137d6f94f0 to your computer and use it in GitHub Desktop.
Save zacharycarter/e14e647ab6cb818675326d137d6f94f0 to your computer and use it in GitHub Desktop.
{.passL: "-framework Foundation".}
{.passL: "-framework AppKit".}
type NSAlert {.importobjc: "NSAlert*", header: "<AppKit/AppKit.h>",
incompleteStruct.} = object
proc messageBox*() =
{.emit: """
NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:@"Message text."];
[alert setInformativeText:@"Informative text."];
[alert addButtonWithTitle:@"Excellent"];
[alert runModal];
""".}
messageBox()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment