まずはGUIから。Object LibraryからWindowオブジェクトを探してObjectリストに追加。追加したらメインウィンドウは閉じて設定ウィンドウを開きデザイン開始。


はじめにウィンドウの名前から。Preferencesとでもしておく。ウィンドウの名前はAttributes Insperctorで。

Attributes Inspectorでさらに設定。最小化・リサイズボタンを無効にする。ControlsのResizeとMinimizeのチェックを外すだけ。

Attributes設定は以上。次はタブアイコンを追加。画面上部にあるアイコン一覧から任意の物をクリックで設定画面の切り替えするけど、あれ実はツールバー。早速ツールバーを追加する。デフォルトであるツールバーのアイテムは全て削除。削除方法はアイコンを選択した状態でDELETEキー。

Image Toolbar Itemを追加。2個追加する。名前はGeneralとAdvancedにする。

アイコン画像はGeneralがNSPreferencesGeneral、AdvancedがNSAdvanced。それっぽいものになってきた。

アイテムをタブのように扱う為にAttributes InspectorのBehaviorでselectableにチェックを入れる。両方のアイテムでselectableにチェック。


Attributesの設定が終わったらアイテムをDefault Toolbar Itemsの領域にD&Dで並べる。

この状態でアプリを起動してみる。

最初から設定ウィンドウが開いた状態で起動してしまった。これはメニューで呼び出されるまでは表示しないようにしたい。それは設定ウィンドウオブジェクトのAttributes Inspectorで設定。BehaviorのVisible At Launchのチェックを外す。

再度起動。設定画面は表示されないね。
表示はメニューバーのアプリメニューのPreferences…からやり方はメインウィンドウの時と同じくWindowControllerで。

設定ウィンドウを開く事が出来るようになった。
設定ウィンドウの作成って実はちょっと手間がかかる。やる事が少し多いから今回はここまで。次回は設定ウィンドウの中身をデザインする。
0 件のコメント:
コメントを投稿