Re: Implementing a Find menu item like Safari?
Re: Implementing a Find menu item like Safari?
- Subject: Re: Implementing a Find menu item like Safari?
- From: Uli Kusterer <email@hidden>
- Date: Fri, 28 Jan 2011 10:04:33 +0100
On Jan 28, 2011, at 4:43 AM, Ben Golding wrote:
> Safari has a really nice "Find" bar that scrolls down from the title pane of the window. I'd like to do something like that in an application that I'm developing but I can't find out whether that's generally available and how to use it.
There's nothing pre-made, but it's easy enough to make. Just create a view with a search field and the right looks embedded in it, then change its size with CoreAnimation (and maybe that of the content area).
> Further, I'd like to be able to highlight the found text in a yellow box like Safari does but again, I can't seem to find how to do that either.
There's nothing generic, you'd have to do it by hand. But if you have an NSTextView (or can get at an NSTextField's field editor), you can use its -showFindIndicatorForRange: method.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
_______________________________________________
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