Safari input type="search" extension and Dashboard Widget

Discussion in 'Mac Programming' started by aftk2, May 21, 2006.

  1. aftk2 macrumors regular

    Nov 10, 2003
    Pacific NW
    First off, I hope this is the correct forum for this question...

    With that out of the way - I'm developing a Dashboard widget, and I'm using the special <input type="search" /> control that has been added to Webkit (this is the text box that rounds the corners, let's you store recently searched terms, etc...)

    This is all fine, except I'd like to do one more thing with it. If you open Safari RSS and go into bookmarks mode, then look at the search field at the bottom of the window, you'll notice that there's a "Search Collections" search field, built into the browser. Instead of recently searched terms, the magnifying glass actually sets the _type_ of search that the box performs. I'd like to do that with my search input, in my Widget (basically, so I can save widget real estate and not have to put a separate "type" dropdown beneath the search field.)

    I imagine that this is possible, at the very least because this is a Cocoa NSSearchField control, and you can write Cocoa into Dashboard widgets (I believe, can't you?) However, I was hoping that it wouldn't be that difficult, and that there was actually an attribute that I could add to the input tag. Documentation on the input type="search" tag is pretty thin, so I haven't had much success. Anyone have any thoughts?

Share This Page