An NSSearchField object implements a text field control that is optimized for performing text-based searches. The control provides a customized text field for entering search data, a search button, a cancel button, and a pop-up icon menu for listing recent search strings and custom search categories. An NSSearchField object wraps an NSSearchFieldCell object.
Questions tagged [nssearchfield]
115 questions
1
vote
2 answers
Background color of NSSearchfield not working
I have a NSSearchField and I want to change its background color but i am not able to do it i tried out few things:
1) I tried to set DrawBackground TRUE and then setBackgroundColor but the value of DrawBackGround is always False either I try to…

Ankita Shrivastava
- 75
- 8
0
votes
1 answer
NSSearchField as first responder
guys! I have a NSSearchField in a window's toolbar. I tell the window to set its first responder to the search field: it works. Now: if I ask the window to tell me what's its first responder, it is NOT the search field even if the search field has…

user732274
- 1,069
- 1
- 12
- 28
0
votes
0 answers
MongoDb: query sub-document with filter on dynamic model
I'm new with mongoDb and struggle to perform a nested search inside a document. I work with a text editor that output it's content in JSON. The editor state is represented with nodes, children and nodes property.
Is it possible to query all the…

Emeric du Gardin
- 1
- 1
0
votes
1 answer
No action sent when NSSearchField is emptied?
I've set up an NSSearchField in a toolbar and connected an action in Interface Builder. This action gets called every time I enter some text, but not when I click the small cross to empty it or I somehow delete the text I just entered. Is this a bug…

Nickkk
- 2,261
- 1
- 25
- 34
0
votes
1 answer
How to reload NSTableView data when NSSearchField text changes
I'm a bit stumped on how to reload a NSTableView's data upon a searchField's text changing. I assumed that I needed to filter the array that the tableView uses to populate itself based upon string matching and the call tableView.reloadData() all…

JonGrimes20
- 115
- 9
0
votes
1 answer
Swift - programmatically trigger NSSearchField filtering
I'm writing a table-based app for MacOS (using NSTableView).
To implement table filtering, I use bindings.
In my app I have a NSTableView that I bind to a NSArrayController, and a NSSearchField that I bind to that same array controller.
This is my…

Uri Yakir
- 141
- 10
0
votes
2 answers
How to set initial width of NSSearchToolbarItem
The default width of NSSearchToolbarItem is way too large. I want it to be similar to the Notes app.
Is there an official way to do this?
The control has a property preferredWidthForSearchField, but this has no effect, which could also be one of the…

Ely
- 8,259
- 1
- 54
- 67
0
votes
0 answers
How to custom the focus ring color of NSTextField?
I have a custom NSTextField, named MySearchField. When I put it on the top of NSVisualEffectView and run my app on macOS 11.x, ring focus color of the text field and background color of selected text both turns white.
It seems that there is no API…

XavierNiu
- 1
- 3
0
votes
1 answer
NSSearchField - How to select all text? (Swift/Storyboards on macOS)
It seems everything online is mostly about iOS/UI controls, not macOS/Cocoa NS controls. Anyway, How does one make an NSSearchField select all text in the field programatically? I have tried multiple methods adapted from the iOS UISearchBar…

Dart Fox
- 1
0
votes
1 answer
Change default insertTab: action in NSSearchfield
I have a view with a nssearchfield a nstableview and a nsmatrix with three radiobuttons. Using delegates i change the selected radiobutton when the searchfield is the firstresponder and the user press tab, that works perfectly but what i want is…

Javier Beltrán
- 756
- 5
- 26
0
votes
1 answer
NumberFormatter for NSSearchField input
I have an NSSearchField where the user can type in a number with decimals to search through data. I am having problems with using a NumberFormatter to display the correct format.
I added this in IB:
What happens is, as soon as the user types the…

koen
- 5,383
- 7
- 50
- 89
0
votes
3 answers
makeFirstResponder does not always fire
I have an NSSearchField inside a NSToolbar that I am attempting to set makeFirstResponder on but it is working intermittently. At times the NSSearchField will become the first responder without the call to makeFirstResponder and makeFirstResponder…

Hamer
- 1,354
- 1
- 21
- 34
0
votes
1 answer
Can't exit NSSearchField after inserted text and cleared it
I added an NSSearchField to my NSViewController, which is the main controller of my outline view. Now it implements next classes:
class MainCatalogNSViewController: NSViewController, NSOutlineViewDelegate, NSOutlineViewDataSource,…

Defari
- 71
- 6
0
votes
1 answer
NSTableView bound to NSSearchField - How to relate selection to unfiltered datasource
I'm stumped. My Swift app uses an NSTableView bound to an array controller, and uses a bound NSSearchField as a text filter. My problem is that the table's selectionIndexes binding gives me the selected indexes in the filtered table, whereas I…

Dave Thompson
- 55
- 9
0
votes
1 answer
swift osx NSSearchField reset programmatically
I'm quite new to swift,
I'm trying to reset a NSSearchField programmatically, but I didn't find a proper way to do this!
At the moment I'm doing in this way
import Cocoa
extension NSSearchField {
func reset() {
self.stringValue = ""
…

justBorn
- 113
- 2
- 7