Re: setting focus on NSSearchField in status bar menu item
Re: setting focus on NSSearchField in status bar menu item
- Subject: Re: setting focus on NSSearchField in status bar menu item
- From: augusto callejas <email@hidden>
- Date: Thu, 8 Jul 2010 13:59:36 -0700
try delaying displaying the menu through a notification:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showPopupMenu:) name:NSApplicationDidBecomeActiveNotification object:nil]
On Jul 8, 2010, at 1:53 PM, Nava Carmon wrote:
> Hi, thank you for answering.
>
> I do the following:
>
> - (void) menuWillOpen:(NSMenu *)menu
> {
>> [statusItem popUpStatusItemMenu: menu];
>> [NSApp activateIgnoringOtherApps:YES];
>
> }
>
> It brings the process to the front, but on first click the menu doesn't stay open, so i have to click it again to show up.
>
> What is the best practice to implement it anyway?
>
> Thanks,
>
> Nava
>
> On Jul 8, 2010, at 11:25 PM, augusto callejas wrote:
>
>> when you click again on your status menu, try making your app the active app:
>>
>> [NSApp activateIgnoringOtherApps:YES];
>>
>> augusto.
>>
>> On Jul 8, 2010, at 12:26 PM, Nava Carmon wrote:
>>
>>> Can somebody answer this please?
>>>
>>> On Jul 8, 2010, at 8:41 AM, Nava Carmon wrote:
>>>
>>>> Hi,
>>>>
>>>> I added a custom view with a NSSearchField as a first menu item to a status bar menu. When I run the application from debugger I can click and write in the NSSearchField. After I go to another application, make it front and click again on my status menu, the NSSearchField shows, but it's disabled and can't get focus. The question is how to cause the NSSearchField to get focus each time, the user clicks to show the menu?
>>>>
>>>> Thanks,
>>>>
>>>> Nava
>>>>
>>>>
>>>> Nava Carmon
>>>> email@hidden
>>>>
>>>> "Think good and it will be good!"
>>>>
>>>> _______________________________________________
>>>>
>>>> Cocoa-dev mailing list (email@hidden)
>>>>
>>>> Please do not post admin requests or moderator comments to the list.
>>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>>
>>>> Help/Unsubscribe/Update your Subscription:
>>>>
>>>> This email sent to email@hidden
>>>
>>>
>>> Nava Carmon
>>> email@hidden
>>>
>>> "Think good and it will be good!"
>>>
>>> _______________________________________________
>>>
>>> Cocoa-dev mailing list (email@hidden)
>>>
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>
>
> Nava Carmon
> email@hidden
>
> "Think good and it will be good!"
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden