Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Focus NSAlert accessory item

I have an NSAlert item that uses an NSTextField as an accessory item to provide an prompt-like dialog box. The only problem that I have is that when the alert is ran the text field is not focused. I tried looking for a way to change NSAlert's first responder but found nothing. Is there a way to easy focus an accessory item in NSAlert?

like image 404
JohnM Avatar asked Aug 21 '10 22:08

JohnM


1 Answers

It seems like you should be able to do something like:

[[alert window] setInitialFirstResponder: myAccessoryView];

before the alert is shown.

like image 64
Mel Avatar answered Oct 11 '22 15:10

Mel