#
# PreferencesController.rb
# PreferencesExample
#
# Created by Matthew McCray on 1/18/08.
# Copyright (c) 2008 Elucidata (www.elucidata.net). All rights reserved.
#

require 'osx/cocoa'

class PreferencesController < OSX::NSWindowController
include OSX

# This is the target action for the toolbar items
ib_action :selectPrefPanel do |sender|
# We'll do stuff here later...
end

def init
self if self.initWithWindowNibName_owner('Preferences', self)
end

# Delegate method that returns the itemIdentifiers for the selectable items
# (in our case, all of 'em)
def toolbarSelectableItemIdentifiers(toolbar)
@toolbaritemidents ||= begin
window.toolbar.items.map {|item| item.itemIdentifier }
end
end

# Select the first toolbar item when the window loads
def awakeFromNib
window.toolbar.selectedItemIdentifier = window.toolbar.items[0].itemIdentifier
end

end