macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

autorecalculatesContentBorderThicknessForEdge:

INDEX>AppKit> NSWindow

境界線の太さを自動計算しているか

Objective-C

- (BOOL)autorecalculatesContentBorderThicknessForEdge:(NSRectEdge)edge

Swift

func autorecalculatesContentBorderThicknessForEdge(_ edge: NSRectEdge) -> Bool

解説

ウィンドウが自動的に与えられた境界線の太さを計算しているかどうか。

何をしているのか今ひとつわからない


NSMaxYEdge: トップ
NSMinYEdge: ボトム

f:id:jjj777:20150222184038p:plain

返り値

Objective-C

BOOL

Swift

Bool

引数

Objective-C

(NSRectEdge)edge

Swift

(_ edge: NSRectEdge)

クラス

NSWindow

使用可能

10.5

参照

関連記事(外部サイト)

例文

Objective-C

Swift

     //NSWindow autorecalculatesContentBorderThicknessForEdge
    //NSWindow setAutorecalculatesContentBorderThickness
    @IBAction func function016(sender: AnyObject) {
        var aWindow : NSWindow
        = NSWindow(contentRect: NSMakeRect(0.0, 0.0, 300.0, 200.0),
            styleMask: NSTitledWindowMask
                | NSClosableWindowMask
                | NSMiniaturizableWindowMask
                | NSTexturedBackgroundWindowMask
                | NSResizableWindowMask,
            backing: .Buffered,
            defer: false,
            screen: NSScreen.mainScreen())
        windowArray.addObject(aWindow) //ウインドウを保持するための配列に追加。アプリ終了時に配列は破棄
        aWindow.center()//ウインドウをスクリーンの中心に
        aWindow.title = "ウインドウタイトル"//タイトル設定
        aWindow.orderFront(self)//前面に
        aWindow.makeKeyAndOrderFront(self)//表示
        if( aWindow.autorecalculatesContentBorderThicknessForEdge(NSMaxYEdge) ){
            NSLog("YES")
        }else{
            NSLog("NO")
        }
        var theButton : NSButton = NSButton(frame: NSMakeRect(0.0, 70.0, 300.0, 30.0))
        theButton.title = "Change"
        theButton.bezelStyle = NSBezelStyle.RoundedBezelStyle
        theButton.action = Selector("buttonAction010:")
        aWindow.contentView.addSubview(theButton)
     
        
        aWindow.setAutorecalculatesContentBorderThickness(false , forEdge: NSMaxYEdge)
        aWindow.setAutorecalculatesContentBorderThickness(false , forEdge: NSMinYEdge)
        aWindow.setContentBorderThickness(0.0 , forEdge: NSMaxYEdge)
        aWindow.setContentBorderThickness(60.0 , forEdge: NSMinYEdge)
        
        
    }

更新時のバージョン

OS X 10.10