Re: NSTextField containing Button?
Re: NSTextField containing Button?
- Subject: Re: NSTextField containing Button?
- From: Adrian Bool <email@hidden>
- Date: Fri, 2 Jan 2004 11:01:44 +0100
Hi Tim,
In order to know when and where to draw as Brian suggests, create
yourself a new class as a decendent of NSTextFieldCell.
In that class override the drawInteriorWithFrame:inView: method (from
NSCell). Do your special drawing there, first than call
[super drawInteriorWithFrame:inView:] to ensure the normal stuff is
drawn as well.
Have a read of the docs on NSControl (TextField's parent) for how to
use your cell instead of the cell. Seems you can either change the
default cell class with [NSTextField: setCellClass:[MyCell class]] (and
change ti back again!) or sub-class NSTextField as well and call
setCell in your new class's initialiser...
I've been thinking about this one too - but as yet not got round to it
;-)
Regards,
aid
On 2 Jan 2004, at 01:50, Brian Smith wrote:
Why not draw it over the text field? Sorry for answering with a
question. This was the first idea that pop up in my mind as a possible
solution.
Brian
On Jan 1, 2004, at 4:19 PM, Tim wrote:
Tim
Does anyone have any idea about how mail goes about placing the blue
button likes objects within the textfield (?) in the To, cc and bcc
address bars. I would like to replicate similar behaviour in one of
my own programs and have no idea where to start.
Many thanks
tim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.