Skip navigation.
 
mlSet focus on NSView in an NSMenuItem
FROM : Hendrik Holtmann
DATE : Fri Jan 04 15:20:39 2008

Hi everyone,

I got another question regarding the new setView method in Leopard.
Let's assume I set the view for an NSMenuItem to myView. myView 
contains an NSTextField. Now when I open the NSMenu I want to set the 
focus on this textfield, so the user can directly enter some text 
without having to click on the control first (like it works in the 
spotlight menu). How can I achieve that? I know how to call 
keyOrderAndFront and setFirstRespinder for NSWindows but how can I do 
this with an NSMenu. Setting the firstresponder for myView to the 
NSTextField does not help unfortunately.

Best,

Hendrik

Related mailsAuthorDate
mlSet focus on NSView in an NSMenuItem Hendrik Holtmann Jan 4, 15:20
mlRe: Set focus on NSView in an NSMenuItem Peter Ammon Jan 4, 21:30
mlRe: Set focus on NSView in an NSMenuItem Pierre Bernard Feb 6, 00:43
mlRe: Set focus on NSView in an NSMenuItem Pierre Bernard Feb 6, 09:37
mlRe: Set focus on NSView in an NSMenuItem Ron Fleckner Feb 6, 11:33
mlRe: Set focus on NSView in an NSMenuItem Pierre Bernard Feb 6, 11:38
mlRe: Set focus on NSView in an NSMenuItem Lieven Dekeyser Feb 15, 13:55