Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
;; @file preferences.nu ;; @discussion Example Preferences Window ;; ;; @copyright Copyright (c) 2008 Matt McCray, Elucidata u0nLTD. (class PreferencesController is NSWindowController (ivars) (- (id)init is (super initWithWindowNibName:"Preferences") (set @toolbarItemIdents NO) self) ;; This is the target action for the toolbar items (- changeTab:(id)sender is (puts "clicked toolbar icon...")) ;; Select the first toolbar item when the window loads (- windowDidLoad is (((self window) toolbar) setSelectedItemIdentifier:(((((self window) toolbar) items) 0) itemIdentifier))) ;; Delegate method that returns the itemIdentifiers for the selectable items (in our case, all of 'em) (- (id)toolbarSelectableItemIdentifiers:(id)toolbar is (unless @toolbarItemIdents (set @toolbarItemIdents (NSMutableArray array)) ((((self window) toolbar) items) each:(do (item) (@toolbarItemIdents addObject:(item itemIdentifier))))) @toolbarItemIdents))
Pasted January 16, 200812:44PM EDT
by Matthew McCray (darthapo)