Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Problems with NSTextView focus...

Problems with NSTextView focus...
Thread Tools
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Feb 19, 2002, 01:50 PM
 
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
Reply With Quote
Feb 19, 2002, 04:53 PM
 
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
Reply With Quote
Feb 19, 2002, 06:07 PM
 
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
Reply With Quote
Feb 19, 2002, 06:49 PM
 
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.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:16 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2