views:

28

answers:

1

I want to implement an NSSearchField showing search results similar to Safari's, but I cannot figure out how to show the menu programmatically. Any pointers would be greatly appreciated.

Update: I tried doing this programmatically by calling @-performClick:@ on the @NSButtonCell@ object that represents the search button inside the search field's search field cell, but while I have confirmed that performClick is indeed called, it does not trigger the menu.

A: 

Safari seems to use some kind of custom or private API to show search results. It's probably a window that looks like a menu. The problem I found is that a normal pop-up menu will take the keyboard focus away from the search field, which is not what you want, which is to be able to keep typing in the search field while the menu updates. I couldn't find a simple way of doing that, but I suspect it needs to be a child window that looks like a menu.

Here's a blog which documented adding something similar to Camino: http://summerofcamino.com/

lucius