Re: Customizing an NSSearchField
Re: Customizing an NSSearchField
- Subject: Re: Customizing an NSSearchField
- From: Tim Lucas <email@hidden>
- Date: Sun, 14 Nov 2004 12:44:33 +1100
On 14/11/2004, at 11:14 AM, Larry Gerndt wrote:
I want to implement something very similar to an NSSearchField to use for the text entry field of a chat window. The NSSearchField's popup would contain a list of predefined chat messages, so I would want to replace the default icon (the magnifying glass) with a different icon.
Create an NSView subclass that displays the icon in its drawRect and displays a sheet containing the predefined messages on mouseDown.
Add your NSView subclass to the textview using [textView addSubView:...].
The mouseDown hit testing starts from the inner-most subview, so you can just position it inside your NSTextView and it will receive the mouseDowns accordingly.
Also, I would want the text entry field to be about twice as tall as the default, so that it can hold about two lines of text that wraps.
Use an NSTextView instead of an NSTextField.
-- tim lucas
http://www.toolmantim.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden