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
0 answers
Changing value of checkbox with bindings
I have a model with a boolean value and 3 strings. I have a UI that has a checkbox and 3 text fields.
The UI elements are all bound to the values in the model using Interface Builder. I'm also using a method on the model to enable and disable the…

ruipacheco
- 15,025
- 19
- 82
- 138
0
votes
1 answer
Enable a button based on a value in the NSTableview
I have a NSTableview. I need to enable the button based on a value of a column in the tableview. For instance, In the table view i have a column, Status. I have 2 kinds of status, Withdrawn and Booked. If i click on a row which has the status as…

user1999892
- 135
- 1
- 8
0
votes
1 answer
NSButton ignoring clicks that come in too close together
NSButton is ignoring clicks that come in too close together.
If I click slowly, all clicks are acknowledged, but if I start to speed up, at a certain point it will stop sending mouseDown: events anymore. If I then slow it down, at a certain point…

AJ.DE
- 185
- 1
- 7
0
votes
1 answer
Programmatically create NSButton and set custom NSButtonCell
Ok, this seems like it should very simple, but I'm coming from iOS and and I must be missing something very obvious. So I have a custom subclass of NSButtonCell. If I create a NSButton in IB and assign the NSButtonCell in IB, it works no…

InfalibleCoinage
- 588
- 13
- 21
0
votes
1 answer
How do you get the key equivalent to display on an NSButton?
I have the key equivalent set and no images set, but the key equivalent does not show on the NSButton. How do I get this to display?
Thank you.

Eric Hartner
- 51
- 3
0
votes
1 answer
NSButton Doesn't Respond to Click When Putting inside M3NavigationView
I'm using M3NavigationView to do view navigations, but there I got a problem when push one view inside(some animation happens here), A button doesn't responds to mouse click most of the time, I'll have to click it twice,
I clicked once on the…

fengd
- 7,551
- 3
- 41
- 44
0
votes
1 answer
NSTextField validation and NSSearchField save it's value to recent history on NSButton click
I have this setup, my NSWinow has two NSSearchFileds with relative autosave search history, one NSTextField and a NSButton.
NSSearchFiled has to autosave the search (wich work right when user press "Enter" key)
NSTextField needs to be validated and…

Shebuka
- 3,148
- 1
- 26
- 43
0
votes
1 answer
Objective-C, changing NSButton functionality?
How can I change the functionality of a button that I used previously? For example, If I had a button that did "Proceed/Cancel" and let's say you "Proceed" the button would change to something such as "View/Go Back"? Basically I want to re-use the…

Joe Habadas
- 628
- 8
- 21
0
votes
1 answer
Change Button Border Properties on IBAction
Why does this allow me to change the bordered state but not the border width (or other border properties)?
NSButton *button = (NSButton *)sender;
[button setBordered:false];
[button setBorderWidth:5];

Charlie Egan
- 4,878
- 6
- 33
- 48
0
votes
1 answer
NSButton with down-facing triangle on the right
I'm trying to make a native NSButton object in IB. When I select Accessory as a Button Type, the title disappears. When I try to write the title, the button is not resizing and the triangle keeps disappearing.
How to make a NSButton with text and…

Galfaroth
- 33
- 7
0
votes
1 answer
How to make a scrolling bar of buttons (buttons bar) with Cocoa?
I would like to have buttons inside a scroll view (or another solution to creating a scrollable button bar).
I have buttons placed side by side in a row along the top of a view. As a user resizes the window to be less wide, fewer buttons can be…

A A
- 147
- 1
- 2
- 8
0
votes
2 answers
Popped Up NSMenu Always Highlights First NSMenuItem
I have an NSButton that when clicked calls [NSMenu popUpMenuPositioningItem:atLocation:inView:]. The menu pops up in the proper location however the topmost NSMenuItem is always highlighted blue, as if the mouse was hovering over it, except that…

Carter
- 4,738
- 2
- 22
- 24
0
votes
2 answers
Enable/disable datepicker with checkbox
I am trying to enable and disable a datepicker with a checkbox, but I can not. What's wrong?
if ([checkBox state]==NSOnState) {
[datePicker isEnabled];
}

Andrea
- 427
- 3
- 16
-1
votes
1 answer
NSButton: blue background
I want to make my NSButton look like Xcode's commit button
But there doesn't seem to be any way to easily change the background color for a NSButton. You have to change the 'border' to No, then set the button's backgroundColor, and set the…

Z S
- 7,039
- 12
- 53
- 105
-1
votes
1 answer
On mouse hover on NSButton Change Cursor (for OSX)
I made a subclass of NSButton
class Button: NSButton {
var cursor = NSCursor()
override func resetCursorRects() {
super.resetCursorRects()
addCursorRect(bounds, cursor: .pointingHand)
}
…

jis thottan
- 41
- 4