Re: Subclassing NSCell questions
Re: Subclassing NSCell questions
- Subject: Re: Subclassing NSCell questions
- From: Arthur VIGAN <email@hidden>
- Date: Wed, 29 Oct 2003 23:27:48 +0100
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.
That works, even is the text is not centered, but that is a small
detail.
- 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 it could, if I can change the drawing... which seems not easy
to do. NSPopUpButtonCell doesn't really fit where I want it to be.
That's why I am trying to make my own control cell. But if you have a
way to make a control with another style that let a menu pop-up when
you click on it, I take it ;-)
-- Arthur
_______________________________________________
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.