NSBezelStyle
ボタンの形状
enum NSBezelStyle : UInt { case RoundedBezelStyle case RegularSquareBezelStyle case ThickSquareBezelStyle case ThickerSquareBezelStyle case DisclosureBezelStyle case ShadowlessSquareBezelStyle case CircularBezelStyle case TexturedSquareBezelStyle case HelpButtonBezelStyle case SmallSquareBezelStyle case TexturedRoundedBezelStyle case RoundRectBezelStyle case RecessedBezelStyle case RoundedDisclosureBezelStyle case InlineBezelStyle }
解説
【ボタンの形状】
Bevel
Push
Check
Radio
Round
Square
Disclosure Triangle
Textured
Help
Gradient
Round Texture
Disclusure
RoundRect
Receseed
Inline
フレームワーク
ApplicationKit
クラス
NSButton
使用可能
10.0
更新時のバージョン
OS X 10.10
関連記事(外部サイト)
例文
//NSButton setPeriodicDelay var counter004 : Int = 0 func buttonAction004(sender: AnyObject?){ var theWindow : NSWindow = (sender as NSButton).window! (sender as NSButton).title = String(counter004++) } @IBAction func function004(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("buttonAction004:")//ボタンを押した時に動かす関数 theButton.target = self//ターゲット theButton.continuous = true //メッセージを繰り返し送信する var floatValue1 : Float = 0 //delayを入れる var floatValue2 : Float = 0 //intervalを入れる theButton.getPeriodicDelay(&floatValue1, interval: &floatValue2) //-> : 0.400000,2 : 0.075000 theButton.setPeriodicDelay(0.5,interval :0.3) aWindow.contentView.addSubview(theButton) aWindow.orderFront(self)//前面に aWindow.makeKeyAndOrderFront(self)//表示 }