Re: How to implement iChat's smiley popup in the text entry field
Re: How to implement iChat's smiley popup in the text entry field
- Subject: Re: How to implement iChat's smiley popup in the text entry field
- From: Larry Gerndt <email@hidden>
- Date: Sat, 13 Nov 2004 11:53:51 -0800
>>>> I would like to implement a popup menu located in the right end of an
>>>> NSTextField just like iChat has for picking a smiley face. Since I'm new
>>>> to
>>>> Cocoa, I'm not sure how to go about this, and would appreciate a pointer on
>>>> the right way to do this.
>>
>>> If you want it to look exactly the same, you have some work cut out for
>>> you...
>>>
>>> The way I would approach this functionality is with a borderless pulldown
>>> NSPopUpButton that uses the TextAndImageCell class from
>>> "/Developer/Examples/AppKit/DragNDropOutlineView/" for its menu items. I
>>> think menus use cells, but I'm not certain; someone else can correct me on
>>> this one.
>>>
>>> Otherwise, you're going to have to create a bunch of custom classes to deal
>>> with the presentation of the popup view, mouse-overs, selection bezels...
>>> ugh. Apple probably has their own APIs for some of this stuff, so it's
>>> easier for them, but it's a lot of work for the rest of us.
>>
>> Fortunately, I don't have to implement the smiley's menu, my menu will be
>> just
>> a regular menu of text strings (predefined chat messages), so I imagine it's
>> quite a bit easier. I just want to know how to get it located properly in
>> the
>> text field such that it looks like it's embedded there and the text field
>> doesn't show text over the icon.
>>
> Oh, then you want NSTextAttachment.
A brief scan of the documentation for NSTextAttachment didn't reveal to me
how this is what I want. Do you happen to have a pointer to some example
where it's used to accomplish what I want?
--
Larry Gerndt
AIM Handle: SonOfTheSonOfMan
Let the truth be told though the heavens fall -- James Garrison
_______________________________________________
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