Re: How to embed a popup menu in an NSTextField
Re: How to embed a popup menu in an NSTextField
- Subject: Re: How to embed a popup menu in an NSTextField
- From: Robbie Haertel <email@hidden>
- Date: Mon, 15 Nov 2004 06:21:38 -0700
I haven't ever done it myself, but I think the best way would be to
subclass NSCell so that it consists of an NSTextFieldCell and an
NSPopupButtonCell. Then you can call setCell: on an instance of your
NSTextField, I believe (you may have to subclass, I'm not sure).
There have been a lot of posts and questions about how to combine an
image and text in NSTableView so there is plenty of code in the
archives, and even an example in the /Developer folder.
Hope this points you in the right direction,
Robbie
On Mon, 15 Nov 2004 10:31:19 +0100, stephane sudre <email@hidden> wrote:
>
>
>
> On Nov 15, 2004, at 8:09 AM, Larry Gerndt wrote:
>
> > (This is a revised version of my original post from a few days ago)
> >
> > I would like to implement a popup menu located in the bottom-right
> > corner an NSTextField (just like iChat has for picking a smiley face,
> > except my menu will be a normal menu of strings). Since I'm new to
> > Cocoa, I'm not sure how to go about accomplishing this.
> >
> > I've gotten some helpful ideas, like trying an NSTextAttachment,
> > which was very interesting, but I couldn't get that work well and to
> > me, it seems like the wrong approach. I know that the Charla project
> > has a way of doing this, and I may have to resort to that, but it
> > would seem to me that some the Cocoa experts out there would know the
> > best approach and I would appreciate very much to hear what that would
> > be. Thanks, and sorry to repost.
> > --
> > Larry Gerndt
>
> Subclass NSTextField and implement a mouseDown: method?
>
> This way you can specify which zone will po-up the menu and call the
> super method for the rest of the control.
>
> _______________________________________________
> 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
>
_______________________________________________
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