resizeIncrements
リサイズするときの増加量を返します
@property NSSize resizeIncrementsvar resizeIncrements: NSSize
解説
リサイズするときの変化量を返します。
幅と高さの変化量は、1.0以上でないといけません。(1.0以下だと例外が発生します。10.10)
アスペクト比(aspectRatio)リサイズ変化量はどちらかしかセットできません。
設定値
変化量
Objective-CNSSizeNSSize
フレームワーク
ApplicationKit
クラス
NSWindow
使用可能
10.0-
参照
- setResizeIncrements:
- setAspectRatio:
- setFrame:display:
更新時のバージョン
OS X 10.10
関連記事(外部サイト)
例文
#import "Controller.h" @implementation Controller - (IBAction)pushButton:(id)sender { NSSize windowSize; [myWindow setResizeIncrements:NSMakeSize(30.0,30.0)]; windowSize = [myWindow resizeIncrements]; [info setStringValue:[NSString stringWithFormat:@"resizeIncrements %.1f,%.1f",windowSize.width,windowSize.height]]; } @end//NSWindow resizeIncrements func buttonAction065(sender: AnyObject){ var theWindow : NSWindow = (sender as NSButton).window! if (theWindow.resizeIncrements.width > 1.0) { theWindow.resizeIncrements = NSMakeSize(1.0, 1.0) }else{ theWindow.resizeIncrements = NSMakeSize(20.0, 20.0) } } @IBAction func function065(sender: AnyObject) { var aWindow : NSWindow = NSWindow(contentRect: NSMakeRect(0.0, 0.0, 300, 200), styleMask: NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask, backing: .Buffered, defer: false) windowArray.addObject(aWindow) //ウインドウを保持するための配列に追加。アプリ終了時に配列は破棄 //ボタンを作成 var theButton : NSButton = NSButton(frame: NSMakeRect(100.0, 2.0, 100.0, 30.0)) theButton.title = "Set" theButton.bezelStyle = NSBezelStyle.RoundedBezelStyle theButton.action = Selector("buttonAction065:") theButton.target = self aWindow.contentView.addSubview(theButton) //ウインドウの表示 aWindow.center()//ウインドウをスクリーンの中心に aWindow.title = "ウインドウタイトル"//タイトル設定 aWindow.orderFront(self)//前面に aWindow.makeKeyAndOrderFront(self)//表示 }