; @file preferences.nu
;; @discussion Example Preferences Window
;;
;; @copyright Copyright (c) 2008 Matt McCray, Elucidata unLTD.
(classPreferencesControllerisNSWindowController
(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 ((((self window) toolbar) items) map:(do (item) (item itemIdentifier)))))
@toolbarItemIdents))