Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6112055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:42:05+00:00 2026-05-23T14:42:05+00:00

I have a text field inside a status item and would like for it

  • 0

I have a text field inside a status item and would like for it to be immediately active when the status item is clicked. I tried the usual becomeFirstResponder in applicationDidFinishLaunching and then in awakeFromNib, but it didn’t work. I imagine t’s because the status item’s menu is not open when those methods get called at launch, possibly ignoring it. Then I tried to set an action when the status item was clicked, but someone here told me that those actions can only be executed if the status item doesn’t have a dropdown menu, which mine does. What I want is for the status item to be clicked, and the dropdown menu to appear with the textfield activated so typing can begin immediately. I’m using a custom view to show the textfield in the menu, not sure if that’s relevant but maybe something else is supposed to be used in this situation?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:42:05+00:00Added an answer on May 23, 2026 at 2:42 pm

    You could set an object as the delegate of the status item’s menu, implement the ‑menuWillOpen: delegate method and then use ‑performSelector:withObject:afterDelay:modes: to set the first responder.

    This will ensure that the call to make the text field the first responder happens in the next run through the event loop, after the menu has opened. You need to pass in NSRunLoopCommonModes or NSEventTrackingRunLoopMode in the array of run loop modes passed to the modes: parameter, because the normal performSelector:withObject:afterDelay: method will not call the selector until the menu is closed.

    - (void)menuWillOpen:(NSMenu *)menu
    {
        [self performSelector:@selector(highlightField) withObject:nil afterDelay:0.0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
    }
    
    - (void)highlightField
    {
        [[yourTextField window] makeFirstResponder:yourTextField];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have a text field which I would like to bind to a
I have a text input field like text box or text area. I want
Suppose you have a text-field in your webpage. The value inside text-field is This
I have a text field where I write a number; if I write inside
UITableViewController doesn't scroll automatically anymore? When you have a text field inside a UITableViewController
I have created some tables with text fields inside, like in the contacts for
I have a dynamic text field inside a MovieClip symbol. Whenever the mouse pointer
I have a dynamic text field (textLabel) inside a Movie Clip (textMC). I am
I have a form. The form contains a text field inside of a div.
I have a button element inside a form like this: <form> <input type=text> <button>Test</button>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.