minFrameWidthWithTitle:styleMask:
タイトルとスタイルを全て表示できる幅を返します
+(float)minFrameWidthWithTitle:(NSString *)sTitle: styleMask:(unsigned int)aStyle:
解説
タイトルとスタイルを全て表示できる最小限の幅を返します
【styleMask】ウインドウのスタイル
● NSBorderlessWindowMask 全部なし
(それぞれを+すると両方とも)
● NSTitledWindowMask タイトルバー
● NSClosableWindowMask クローズボタン
● NSMiniaturizableWindowMask 最小化ボタン
● NSResizableWindowMask リサイズボタン
フレームワーク
ApplicationKit
クラス
NSWindow
使用可能
10.0
参照
関連記事(外部サイト)
更新時バージョン
10.10
例文
#import "Controller.h" @implementation Controller - (IBAction)pushButton:(id)sender { float windowWidth; windowWidth = [NSWindow minFrameWidthWithTitle:@"TitleString" styleMask:[myWindow styleMask]]; [info setStringValue:[NSString stringWithFormat:@"%.1f",windowWidth]]; } @end