view
ツールバー項目のビューを返します
解説
ツールバー項目のビューを返します。
返り値
( NSView * )
ビュー
引数
フレームワーク
ApplicationKit
クラス
NSToolBarItem
Instance Methods
使用可能
10.1
参照
- setView:
例文
//ツールバー項目のセット - (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *) itemIdent willBeInsertedIntoToolbar:(BOOL) willBeInserted { NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease]; [toolbarItem setLabel: @"CustomItem"];//ツールバーのラベル [toolbarItem setPaletteLabel: @"paletteCustomItem"];//カスタムパレットラベル [toolbarItem setToolTip: @"CustomItem"];//ツールティップ //[toolbarItem setImage: [NSImage imageNamed: @"CustomItemImage"]];//アイコン // [toolbarItem setView:toolBarView]; [toolbarItem setMinSize : [toolBarView bounds].size]; [toolbarItem setMaxSize : [toolBarView bounds].size]; [toolbarItem setTarget: self];//ターゲット [toolbarItem setAction: @selector(myToolBar:)];//セレクタ NSLog([[toolbarItem view] className]); return toolbarItem; }