removeStatusItem:
ステータスバーからステータス項目を削除します
-(void)removeStatusItem:(NSStatusItem*)item:
解説
ステータスバーからステータス項目を削除します。
右側へと詰めます。
(10.1では機能しないかもしれません)
返り値
( void )
なし
引数
( NSStatusItem* )item
ステータス項目
フレームワーク
ApplicationKit
クラス
NSStatusBar
Instance Methods
使用可能
10.0
参照
- statusItemWithLength:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //sItem = [[[NSStatusItem alloc] init] autorelease]; sBar = [NSStatusBar systemStatusBar]; sItem= [sBar statusItemWithLength:NSVariableStatusItemLength]; [sItem retain]; [sItem setTitle: NSLocalizedString(@"SB_title",@"")]; [sItem setHighlightMode:YES]; [sItem setMenu:sbMenu]; } - (IBAction)remove:(id)sender { [[sItem statusBar] removeStatusItem:sItem]; NSLog(@"!!!"); } @end