• 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
Re: Customizing an NSSearchField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Customizing an NSSearchField
      • From: Tim Lucas <email@hidden>
References: 
 >Customizing an NSSearchField (From: Larry Gerndt <email@hidden>)

  • Prev by Date: Customizing an NSSearchField
  • Next by Date: Re: How to implement iChat's smiley popup in the text entry field
  • Previous by thread: Customizing an NSSearchField
  • Next by thread: Re: Customizing an NSSearchField
  • Index(es):
    • Date
    • Thread