tags:

views:

105

answers:

3

An NSControl's cell isn't in the view hierarchy. Am I correct?

If it isn't, how is it being drawn on the view if it's not in the view hierarchy?

I ask because I want to have a View/Control subclass that I can drag out onto a contentview, then add buttons into that view, and have the lowest component be the cell. So the cell can get all the click events, do something, then pas them onto the buttons.

Window ->ContentView -> CustomView ->(Button, Button, Button)

+2  A: 

Read Apple's docs. In a nutshell, a control's -drawRect: sends -drawInteriorWithFrame:inView: and/or -drawWithFrame:inView: to its cell which does the actual drawing.

Costique
+2  A: 

A cell is not a view, it has no place in the view hierarchy. You should think of a cell as something that a view uses to draw a portion of the view's contents, and to handle certain events.

The reason that cells exist, is that views are somewhat heavyweight.

NSResponder
A: 

NSResponder, thanks tahts what I thought.

Costique, I always check apple's docs first. I was just looking for clarification.

joels