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
0
votes
1 answer
Objective-C NSButton Toggle
I have search and can't find any information so I would like some help here. I am new to Xcode and objective c. I have 10 NSButtons set in Interface Builder to be Push On Push Off type. I am trying to figure out how when one of the buttons is…

user3219542
- 3
- 1
0
votes
1 answer
AppDelegate logging as NSButton
I'm trying to access the instance variables I've declared in my AppDelegate, but my class seams to think that my AppDelegate is an NSButton.
I borrowed this code from Referencing AppDelegate instance variables
AppDelegate *appDelegate = (AppDelegate…

Scott Hillson
- 900
- 1
- 12
- 30
0
votes
1 answer
Check if nsbutton is intersected for a certain number of seconds
I have a cursor object and I want to be able to tell when it intersects an nsbutton, and whether it does continuously for a 3 seconds. My code works except that when the cursor comes near a button, it freezes until it has been three seconds and then…

user3247022
- 69
- 1
- 9
0
votes
1 answer
Custom NSButton not working from CoreMIDI callback function
I'm creating a piano app (for OSX) that has an onscreen keyboard that displays what the user is playing on their synth keyboard. Everything is connected using the CoreMIDI framework. I have created some customs buttons by subclassing NSButton in a…

02fentym
- 1,762
- 2
- 16
- 29
0
votes
1 answer
Setting default checkbox value in Objective-C?
Okay, this one's making me feel stupid...
I'm a feature film editor who's recently started teaching myself Objective-C after many years away from coding. I think the last code I wrote was in Cobol, if that gives you any indication.
Anyway, I've…

ConleeC
- 337
- 6
- 13
0
votes
1 answer
NSButton layer.contentscenter Not Stretching Properly
I'm trying to create an NSButton with a custom background using the technique found here: http://youtu.be/7MZJxPOo_xU. Everything worked fine for me except the part at the end where he explains how to use self.layer.contentscenter to make sure the…

Matt Cooper
- 2,042
- 27
- 43
0
votes
1 answer
How to stop click thought an NSView?
I am making app with cocoa(Mac desktop application). I have a NSButton in background of an NSView. The button is clicked even if any NSView is added later in NSWindow.
How to stop click on a button that is at background any NSView ?
Please give…

MOHAMMED MINHAZ
- 21
- 2
0
votes
1 answer
NSButton in NSToolbar item: click issue
I want to use a NSButton configured to show only an image in my NSToolbarItem. The item is created in IB and the code to add the button to it is:
NSButton *button = [[NSButton alloc]init];
[button setImage:[NSImage imageNamed:@"StarEmpty"]];
[button…

Luca
- 1,704
- 3
- 29
- 42
0
votes
1 answer
How to differentiate mouse click from key press for NSButton in IBAction
Currently I have an IBAction for a NSButton, and the NSButton also has a key equivalent. I would like to know if there is a way inside my IBAction function "strike"
- (IBAction)strike:(id)sender
that can tell me whether this action is triggered by…

wc373
- 45
- 1
- 7
0
votes
1 answer
Custom shaped NSButton
I am trying to create eight custom buttons (NSButton) in Xcode 4.6.3. Those are the segments of a circle. I used a standard rectangular button for each of them, adding a custom image for each segment. However, when I put the pieces together in one…

SevenFridays
- 3
- 2
0
votes
0 answers
How to avoid NSpanel to be opened as different objects
I'm having a NSCollectionView consist of 10 NSButtons and also dragged a NSpanel from object library. If i click a button NSpanel should be appeared.If i clicked the next button, last generated NSpanel should closed and another NSpanel was opened.…

Muruganandham K
- 5,271
- 5
- 34
- 62
0
votes
1 answer
How to caputure keyDown event in NSbutton after a mouseClick
I'm having five Image Buttons. If a button was clicked by mouse, then the button went to Onstate. Now if i pressed Space button it will zoom the button's image in a seperate Window.
The space button should not work when the button id in OFFstate.…

user23790
- 563
- 3
- 21
0
votes
0 answers
NSMenu Not connecting method of another class
-(void)rightMouseDown:(NSEvent *)theEvent
{
cvcont = [[CollectionViweItemSubClass alloc] init ];
NSMenu * m = [[NSMenu alloc] init];
//[cvcont openInFinder];----perfectly working------
[self setTarget:cvcont];
[m…

user23790
- 563
- 3
- 21
0
votes
1 answer
Disabling buttons in matrix in OSX
How to disable few NSButtons in a matrix of push buttons? Each button has a specific tag and title. To achieve this functionality the button should be bordered or borderless?

user2118335
- 1
- 1
- 5
0
votes
2 answers
How to programmatically allocate a subclass of NSButton with a custom NSButtonCell?
I' m trying to create a subclass of NSButton thats use also a subclass of NSButtonCell but I can' t do that in code!
This is my NSButonCell subclass that's works well if I create the button in IB and set his cell class directly in IB:
#import…

Luca
- 1,704
- 3
- 29
- 42