Re: Subclassing NSCell questions
Re: Subclassing NSCell questions
- Subject: Re: Subclassing NSCell questions
- From: "Alastair J.Houghton" <email@hidden>
- Date: Wed, 29 Oct 2003 18:00:48 +0000
On Wednesday, October 29, 2003, at 04:52 pm, Arthur VIGAN wrote:
Hi,
I have subclassed NSCell to create a custom control, but I have two
questions:
- As I implement my own -
(void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView
*)controlView, do I have to drawn the title of the control myself, or
is there a way for it to be drown for me?
If you subclassed a plain NSCell, I think you can just do
[super drawInteriorWithFrame:cellFrame inView:controlView]
to get NSCell to draw it for you. Obviously you need to decide when to
call that method.
- I would like to have a menu appear when I click on the custom
control, but without pressing the control key. Is it possible?
It sounds like you should probably subclass NSPopUpButtonCell. In
fact, are you sure your control can't be implemented as a standard
pop-up button?
Actually, this is an interesting question, because NSMenuView is
supposedly deprecated. I'd be interested if anyone knows how we're
supposed to display a menu programmatically.
Kind regards,
Alastair.
_______________________________________________
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.