Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 3, 2004, 01:21 PM   #1
NusuniAdmin
Guest
 
NusuniAdmin's Avatar
 
Join Date: Nov 2003
Cocoa, getting focused control

How would I go about getting the currently focused control? I mean there has to be some method I am missing that will return an identifier for the currently focused control.

Also is there a method or something that is called each time a control gets focused and loses the focus.


The reason I am asking is I want some specific things to happen when a control gets its focus and when it loses it.
NusuniAdmin is offline   0 Reply With Quote
Old Oct 3, 2004, 03:03 PM   #2
iMeowbot
macrumors 601
 
iMeowbot's Avatar
 
Join Date: Aug 2003
You can call the window's firstResponder to get a pointer to the object with that status. Is that what you mean?

This article contains an example; see textObjectToSearchIn

Last edited by iMeowbot; Oct 3, 2004 at 03:26 PM.
iMeowbot is offline   0 Reply With Quote
Old Oct 3, 2004, 03:50 PM   #3
NusuniAdmin
Thread Starter
Guest
 
NusuniAdmin's Avatar
 
Join Date: Nov 2003
this may do what I want, thnx. I will try it out and see how it goes.
NusuniAdmin is offline   0 Reply With Quote
Old Oct 3, 2004, 07:37 PM   #4
NusuniAdmin
Thread Starter
Guest
 
NusuniAdmin's Avatar
 
Join Date: Nov 2003
hmm how come when resignFirstResponder i cannot edit the text in the text field?

like [self setStringValue:@"bla"]; does nothing at all in the resignFirstResponder method.
NusuniAdmin is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
phones: Non-iPhone but focused on battery life (screentime)? Jibbajabba Alternatives to iOS and iOS Devices 2 Aug 2, 2013 06:35 AM
General: If Apple focused on 1 thing in iOS 7 irDigital0l iOS 7 21 Jan 24, 2013 11:39 AM
get focused window in desktop by kernel modules(kext) mehdies Mac Programming 1 Dec 18, 2012 11:29 PM
T-Mobile USA Focused on 'Selling Against the iPhone' Starting September 21 MacRumors MacRumors.com News Discussion 111 Sep 4, 2012 04:16 AM
If iOS 6 focused on stock apps, this is what I want irDigital0l iOS 5 and earlier 6 Jun 3, 2012 02:24 PM

Forum Jump

All times are GMT -5. The time now is 03:48 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC