setButtonType:
ボタンタイプをセットします
- (void)setButtonType:(NSButtonType)aType
func setButtonType(_ aType: NSButtonType)
解説
ボタンタイプをセットします。
【NSButtontype】
● NSMomentaryLight
● NSMomentaryPushButton
● NSMomentaryChangeButton
● NSPushOnPushOffButton on/offボタン
● NSOnOffButton
● NSToggleButton
● NSSwitchButton チェックボックス
● NSRadioButton ラジオボタン
返り値
なし
フレームワーク
ApplicationKit
クラス
NSButton
使用可能
10.0-
関連記事(外部サイト)
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //senderはボタン [sender setButtonType : NSToggleButton ]; } @end
//NSButton setButtonType //Swift2.0 @IBAction func function001(sender: AnyObject) { myButton.setButtonType(NSButtonType.PushOnPushOffButton) // MomentaryLightButton // was NSMomentaryPushButton // PushOnPushOffButton // ToggleButton // SwitchButton // RadioButton // MomentaryChangeButton // OnOffButton // MomentaryPushInButton // was NSMomentaryLight }
更新時のバージョン
OS X 10.10