NuでMacのGUIプログラムを作る記事を書きました
CodeZineに NuでMac GUIプログラミング Twitterクライアントを作ってみよう という Nu (Lispの一種) を使って Mac の GUIプログラムを作る記事を書きました
上の画像のような、素敵なGUIアプリが Lisp で書けます !! ....続きは CodeZine
(load "Nu:nu") (load "Nu:cocoa") (load "Nu:menu") (load "functions") (load "twitter") (class ApplicationDelegate is NSObject (ivar (id) tableView (id) textField (id) timeLines) (- (void) awakeFromNib is (let (theColumn (@tableView tableColumnWithIdentifier:"icon")) (theColumn setDataCell:((NSImageCell alloc) initImageCell:nil)))) (- (void) applicationDidFinishLaunching:(id) sender is (set @timeLines (Twitter time-lines)) (@tableView reloadData) ) (- (void) pushRefreshButton:(id) sender is (set @timeLines (Twitter time-lines)) (@tableView reloadData) ) (- (void) pushPostButton:(id) sender is (Twitter post-tweet:(@textField stringValue))) (- (int) numberOfRowsInTableView:(id) aTableView is (@timeLines count)) (- (id) tableView:(id) aTableView objectValueForTableColumn:(id) aTableColumn row:(int) rowIndex is (case (aTableColumn identifier) ("icon" ((NSImage alloc) initWithContentsOfURL: (NSURL URLWithString:(tl-icon (@timeLines objectAtIndex:rowIndex))))) ("name" (tl-name (@timeLines objectAtIndex:rowIndex))) ("text" (tl-text (@timeLines objectAtIndex:rowIndex))) (else ""))) (- (BOOL) applicationShouldTerminateAfterLastWindowClosed:(id) theApplication is YES) ) ((NSApplication sharedApplication) setDelegate:(set delegate ((ApplicationDelegate alloc) init))) ((NSApplication sharedApplication) activateIgnoringOtherApps:YES) (NSApplicationMain 0 nil)