The NSButton class is a subclass of NSControl that intercepts mouse-down events and sends an action message to a target object when it’s clicked or pressed.
Questions tagged [nsbutton]
535 questions
-1
votes
1 answer
Setting Multiline Title To NSButton In Cocoa App
I understand the NSButton guidelines for setting title to NSButton, No offence but the requirement should be fulfilled in my case.
I want to show NSButton title in two lines.
NSButton *btn = [[NSButton alloc] init];
[btn setTitle:@"multiple line…

Vikram Sinha
- 581
- 1
- 10
- 25
-1
votes
1 answer
How to add multi-line text using NSAttributedString to a NSButton?
My application supports multiple languages. I have a Translation object which sets string on NSButton Title. How can I use multiline to set text inside my Button?
I used self.lineBreakMode = .ByWordWrapping but it does not work.
class…

SAURABH SANWAL
- 139
- 1
- 11
-1
votes
1 answer
NSButton cannot setaction
I am trying to add an action to a NSButton but it is not working
I create my NSButtton programmatically:
-(NSView *)rowTable:(CGFloat) heightOnPanel :(NSString *) textValue: (CGFloat) width: (CGFloat) height :(int) intColor{
NSView *viewce =…

UIJoker
- 19
- 3
-1
votes
1 answer
Connecting button programmatically XCode9, Objective-C, OSX
im on OSX, XCode9, Objective C.
I have a viewController layouted in IB. The view contains a button connected to the corresponding viewController
SHTourViewController.h
@property (weak) IBOutlet SHStandardButton *closeButton;
// SHStandardButton is a…

Pat_Morita
- 3,355
- 3
- 25
- 36
-1
votes
1 answer
swift mac osx NSButton is not responding until a long press
I am having a weird issue with a button. So I have a NSViewController with many subviews in it. When I click a button, a new NSView with click gestures and buttons is added on top. But I can't press any of them, they don't respond unless a click for…

Rafael Jimeno
- 626
- 2
- 8
- 20
-1
votes
1 answer
Button not showing in .nib file
So I downloaded CircleView and tried to change the code. The program came with a button, color wheel, 2 sliders, and a view. When ever I add anything (Slider, button, textfield), on run time the things I added wouldn't show up. What am I not…

31i45
- 315
- 1
- 2
- 12
-1
votes
2 answers
Xcode v7.2 - New Radio Buttons: How to find selected
I am attempting to detect which Radio Button is currently selected using Xcode 7's new Radio Button template (NSButton).
I have created a simple action that will print to log the title of the sender when a radio button is selected. This does…

Steven Carlson
- 925
- 1
- 10
- 25
-1
votes
2 answers
Instances variables in subclass of NSButton and connecting new button with Interface Builder
In order to access -mouseUp and -mouseDown events in a button I have subclassed NSButton and I also want to store a few extra variables within the object:
@interface MoveButton : NSButton{
unsigned char cmd[3];
unsigned char stop[3];
…
-2
votes
1 answer
Why does this code not work?
So I have the following code to create an NSButton, and put it on the screen. However, when I run this code, nothing happens. What is wrong with this?
NSButton *newbutton = [[NSButton alloc] initWithFrame:NSMakeRect(100, 100, 109, 151)];
…

Regan
- 1,487
- 2
- 28
- 43
-3
votes
1 answer
Hide NSTouchBar button
I'm working on a personal project in swift (for macOS app) and I want to make a NSbutton (Touch Bar button) and hide it.
Is there a possible way to do this?

AsafH
- 89
- 2
- 9