 |
 |
Problems with NSTextView focus...
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
I'm trying to set up an NSTextView to automatically get the focus when a window opens. Ideally, you should just be able to start typing when the window shows up.
Unfortunately, I'm having a heck of a time trying to figure it out. I've set the NSTextView to be the window's initialFirstResponder, and it behaves as though it were, except that it's not focused. You have to actually click in it before it will accept anything you type in, and that isn't cool. Anyone else have any ideas on what I can do about this one?
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status:
Offline
|
|
ok, i assume the window containing the nstextfield is the key window, right?
have you tried cleaning the active target?
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
Originally posted by seb2:
<STRONG>ok, i assume the window containing the nstextfield is the key window, right?
have you tried cleaning the active target?</STRONG>
No, but explicitly setting it as the first responder programmatically seems to have fixed it.
I think what's going on was that I have a toolbar in this window as well. The toolbar has to be set up programmatically, and I think it may have been stealing the FirstResponder status. So setting it again seems to have fixed the problem. If anyone has a better solution, though, I'd like to hear it; this seems more than a little hackish to me.
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status:
Offline
|
|
hmm, i wrote an app with a toolbar that is only set up programatically, the firstresponder for my textfield works.
on the other hand, i have to pretty much set up every nextkeyview programmatically because whatever ib tells me, it just doesn't work.
might be sometimes things just don't make sense, set them programatically and if it works -- don't ask why.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |