• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Subclassing NSCell questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Subclassing NSCell questions
      • From: Arthur VIGAN <email@hidden>
References: 
 >Subclassing NSCell questions (From: Arthur VIGAN <email@hidden>)

  • Prev by Date: Re: Custom View (NSView) Drawing Problem in 10.3
  • Next by Date: Re: Blocks in Obj-C (was: Passing Obj-C method as callback to C function)
  • Previous by thread: Subclassing NSCell questions
  • Next by thread: Re: Subclassing NSCell questions
  • Index(es):
    • Date
    • Thread