Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.69 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. (function text-view (frame)
  2.   ((NSTextView alloc) initWithFrame: frame))
  3.  
  4. (function text-field (frame)
  5.      (((NSTextField alloc) initWithFrame: frame)
  6.       set: (bezeled:0 editable:0 alignment:NSCenterTextAlignment drawsBackground:0)))
  7.  
  8. (function alert-box (title message)
  9.   (let (alert (NSAlert new))
  10.     (let (t (text-view '(0 0 300 100)))
  11.       (alert setAccessoryView: t))
  12.     (alert addButtonWithTitle: "Commit")
  13.     (alert addButtonWithTitle: "Cancel")
  14.     (alert setMessageText: title)
  15.     (alert setInformativeText: message)
  16.     (set result (alert runModal))
  17.     (alert release)))
  18.  
  19. (alert-box "Commit changes?" "There are #{6} staged files to be committed. Would you like to commit them now?")