Questions tagged [nscontrol]

NSControl is an abstract superclass that provides three fundamental features for implementing user interface devices: drawing devices on the screen, responding to user events, and sending action messages. It works closely with the NSCell class.

60 questions
13
votes
4 answers

NSButton mouseDown mouseUp behaving differently on enabled

If the NSButton is not enabled, the mouseDown: and mouseUp: behave as expected (so when the mouse is pushed down, the mouseDown: is called, and when it is released, the mouseUp: is called) However, if the NSButton IS enabled, than the mouseUp:…
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
13
votes
1 answer

Guides or samples for NSRuleEditor?

NSRuleEditor looks like a pretty powerful class and it looks like stuff like iTunes Smart Playlists or Finder Smart Folders are using it. (I reckon it should be called NSSmartRuleEditor...) But is there any kind of documentation apart form the…
Jay
  • 6,572
  • 3
  • 37
  • 65
10
votes
2 answers

NSPopUpButton set it to the first item

I have a clear button in my Mac OS app. When the button is pressed, it clears all the values of the form and resets the NSPopUpButton to the first item. The question is how do I change the NSPopUpButton control with code. Thanks
Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177
9
votes
1 answer

In OS X 10.10, can I implement an NSControl without an NSCell?

I am learning about NSControl. I am aware that NSCell has begun its road to deprecation in OS X 10.10 Yosemite, and so I'd rather not use an API that is going away. Also, the NSControl Class Reference shows all cell accessors have been deprecated. I…
Ryan Ballantyne
  • 4,064
  • 3
  • 26
  • 27
8
votes
1 answer

NSTextField autocompletion delegate method not called

I implemented the following delegate method for NSTextField to add autocompletion support: - (NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words …
indragie
  • 18,002
  • 16
  • 95
  • 164
8
votes
3 answers

TAB in custom NSTextField does not put focus on another control

I have a custom NSTextField, where I'm implementing some rounded corners. Pressing the "TAB" key does not go to the next NSTextField (or selectable control) in the window. Weird. Why would it do that? Is there something special I need to add to…
Alex
  • 7,432
  • 20
  • 75
  • 118
8
votes
1 answer

In a view-based NSTableView, how make a control the first responder with a single click?

View-based NSTableViews seem to have just the standard behavior, where, in order to make a text field inside the table the first responder, the user has to either double click or to single click and "keep calm". However, given the flexibility…
5
votes
1 answer

NSSegmentedControl highlighting with blue tint and single-selection

Is there a documented way for an NSSegmentedControl to use the trackingMode NSSegmentSwitchTrackingSelectOne (i.e. exclusively select one segment in the control) and have it rendered using the blue tint highlighting mode - the one we get…
ATV
  • 4,116
  • 3
  • 23
  • 42
5
votes
1 answer

Objective-C: Proper handling of shared properties between subclassed NSControl and NSActionCell?

One of the things I've always been unsure of is how to properly handle communication between a custom NSControl subclass and an NSCell subclass. Throughout my introduction to Cocoa, I've seen it mentioned several times how the parent control…
Ben Stock
  • 1,986
  • 1
  • 22
  • 30
4
votes
2 answers

How can you get an NSButton to detach from an NSStackView when the stack view resizes?

How can you get an NSButton to detach from an NSStackView when the stack view resizes? NSControl subclasses that use NSCell drawing seem to have a different mind than other NSView subclasses on visibility with compression resistance in Auto…
uchuugaka
  • 12,679
  • 6
  • 37
  • 55
4
votes
1 answer

NSString drawInRect:withAttributes: causes 'unrecognized selector sent to instance ...'

I got something really strange: a method causes unrecognized selector sent to instance, but doesn't NSLog() anything at all. I made a custom NSControl subclass, where I try to draw my custom cells like this: - (void)drawRect:(NSRect)dirtyRect { …
11684
  • 7,356
  • 12
  • 48
  • 71
3
votes
1 answer

Drawing NSControl when the windows is key or not

I have a NSControl subview and I want to change the drawing when the control is not on a keyWindow. The problem is that I don't see any property that reflects that state (tried enabled property but that was not it). In simple terms, can I…
gcamp
  • 14,622
  • 4
  • 54
  • 85
3
votes
1 answer

Cocoa - NSSearchFieldDelegate methods is not called

I have simple NSSearchField on view of NSVIewConroller. and connected the NSSearchFIeld's delegate to the view controller. And I have implemented the NSSearcHFieldDelegate Methods as follows: - (void)searchFieldDidStartSearching:(NSSearchField…
Shanmugaraja G
  • 2,778
  • 4
  • 31
  • 47
3
votes
2 answers

Detect when delete key pressed on control

How can I subclass a NSControl object (such as a NSImageView) to detect the press of the delete key? Specifically I want to clear an image from a NSImageView, but there are probably wider applications.
glenstorey
  • 5,134
  • 5
  • 39
  • 71
3
votes
1 answer

NSTextField in NSTableCellView - end editing on loss of focus

I have a view with a view-based NSTableView (which itself has a cell view with a single text field) and some buttons and textfields outside the tableview. One of the buttons adds an object into the datasource for the tableview, and after inserting…
Z S
  • 7,039
  • 12
  • 53
  • 105
1
2 3 4