Skip to content

Instantly share code, notes, and snippets.

@jeremytregunna
Created August 6, 2011 16:49
Show Gist options
  • Select an option

  • Save jeremytregunna/1129508 to your computer and use it in GitHub Desktop.

Select an option

Save jeremytregunna/1129508 to your computer and use it in GitHub Desktop.
(function text-view (frame)
((NSTextView alloc) initWithFrame: frame))
(function text-field (frame)
(((NSTextField alloc) initWithFrame: frame)
set: (bezeled:0 editable:0 alignment:NSCenterTextAlignment drawsBackground:0)))
(function alert-box (title message)
(let (alert (NSAlert new))
(let (t (text-view '(0 0 300 100)))
(alert setAccessoryView: t))
(alert addButtonWithTitle: "Commit")
(alert addButtonWithTitle: "Cancel")
(alert setMessageText: title)
(alert setInformativeText: message)
(set result (alert runModal))
(alert release)))
(alert-box "Commit changes?" "There are #{6} staged files to be committed. Would you like to commit them now?")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment