length
ステータスバーでのステータス項目の長さを返します
解説
ステータスバーでのステータス項目の長さ(ピクセル)を返します。
その他の定数として
● NSSquareStatusItemLength ステータスバーの厚さ
● NSVariableStatusItemLength ステータス項目の大きさ
があります。
返り値
( float )
スペースの合計
引数
フレームワーク
ApplicationKit
クラス
NSStatusItem
Instance Methods
使用可能
10.0
参照
- setLength:
- statusItemWithLength: (NSStatusBar)
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSStatusBar *sBar = [NSStatusBar systemStatusBar]; NSStatusItem *sItem = [sBar statusItemWithLength:NSVariableStatusItemLength]; [sItem retain]; [sItem setTitle: NSLocalizedString(@"SB_title",@"")]; [sItem setHighlightMode:YES]; [sItem setMenu:sbMenu]; NSLog([NSString stringWithFormat:@"%.1f",[sItem length]]); } @end