• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Inserting an NSSearchField inside an NSMenuItem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inserting an NSSearchField inside an NSMenuItem


  • Subject: Inserting an NSSearchField inside an NSMenuItem
  • From: augusto callejas <email@hidden>
  • Date: Fri, 4 Jun 2010 17:25:51 -0700

hi-

i'm adding an NSSearchField to an NSMenu by creating an NSMenuItem
and calling setView with the search field as the argument.  i'm able to display
the search field properly, but it doesn't gain focus (no blinking cursor in the
search field) either when the NSMenu is displayed or when i click on the search
field itself.  i found a previous discussion and none of its approaches have worked:

http://lists.apple.com/archives/cocoa-dev/2008/Jan/msg00138.html

my code:

    NSMenuItem* firstItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@"Test" action:nil keyEquivalent:@""];
    NSSearchField *cField = [[[NSSearchField alloc] initWithFrame:NSMakeRect(0.0, 0.0, 250.0, 22.0)] autorelease];
    [menu addItem:firstItem];
    [firstItem setView:cField];

any ideas?

thanks,
augusto._______________________________________________

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

  • Prev by Date: Re: Monster memory leak and I can't figure out why
  • Next by Date: Re: Cocoa: dragging files from Finder
  • Previous by thread: Re: Cocoa: dragging files from Finder
  • Next by thread: Re: PDFSelection from a range
  • Index(es):
    • Date
    • Thread