macOS/iOS API解説

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

目次

bordered

INDEX>AppKit>NSButton

ボタン枠

Objective-C

@property(getter=isBordered) BOOL bordered

Swift

var bordered: Bool

解説

枠線あり
f:id:jjj777:20150228152938p:plain

枠線なし
f:id:jjj777:20150228152948p:plain

返り値

Objective-C

Swift


フレームワーク

NSAnimationContext

クラス

NSButton

使用可能

10.0

更新時のバージョン

OS X 10.10

参照

関連記事(外部サイト)

例文

Objective-C

Swift

    //NSButton
    @IBAction func function011(sender: AnyObject) {
        var aWindow : NSWindow
        = NSWindow(contentRect: NSMakeRect(0.0, 0.0, 300.0, 200.0),
            styleMask: NSTitledWindowMask
                | NSClosableWindowMask
                | NSMiniaturizableWindowMask
                | NSResizableWindowMask,
            backing: .Buffered,
            defer: false,
            screen: NSScreen.mainScreen())
        windowArray.addObject(aWindow) //ウインドウを保持するための配列に追加。アプリ終了時に配列は破棄
        aWindow.center()//ウインドウをスクリーンの中心に
        aWindow.title = "ウインドウタイトル"//タイトル設定
        //
        var theButton : NSButton = NSButton(frame: NSMakeRect(50.0, 50.0, 100.0, 30.0))
        theButton.title = "Change"
        theButton.bezelStyle = NSBezelStyle.RoundedBezelStyle
        theButton.action = Selector("buttonAction002:")
        theButton.target = self
        theButton.bordered = true

        aWindow.contentView.addSubview(theButton)
        
        aWindow.orderFront(self)//前面に
        aWindow.makeKeyAndOrderFront(self)//表示

    }