macOS/iOS API解説

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

目次

contentBorderThicknessForEdge

INDEX>AppKit> NSWindow

Objective-C

- (CGFloat)contentBorderThicknessForEdge:(NSRectEdge)edge

Swift

func contentBorderThicknessForEdge(_ edge: NSRectEdge) -> CGFloat

解説

【調査中】今ひとつ使いドコロがわからない。
ウィンドウの任意の境界線の太さを示します
テクスチャウインドウで有効

NSMaxYEdge: Top border.
NSMinYEdge: Bottom border.

f:id:jjj777:20150222184038p:plain

返り値

Objective-C

CGFloat

Swift

CGFloat

引数

Objective-C

NSRectEdge

Swift

NSRectEdge

クラス

NSWindow

使用可能

10.5

参照

関連記事(外部サイト)

Getting the "iCal" window style? | Cocoabuilder

例文

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