1

I have subclassed NSControl to get my custom control, have subclassed NSCell to get my custom cell, over overridden -(BOOL)trackMouse:inRect:ofView:untilMouseUp and necessary methods in custom cell, have overridden + (Class)cellClass in customControl to return my customCell,

Cell draws fine on control, set enable, set dissable works fine, but Mouse events not getting triggered. While debugging i noticed that -(BOOL)trackMouse:inRect:ofView:untilMouseUp: is never invoked. As per "Control and cell programming guide" -

"Controls manage the behavior of their cells. By inheritance from NSView, controls derive the ability for responding to user actions and rendering their on-screen representation. When users click on a control, it responds in part by sending trackMouse:inRect:ofView:untilMouseUp: to the cell that was clicked"

Kindly tell if i am missing something - i have googled a lot got nothing useful.

Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140
Suhas Aithal
  • 842
  • 8
  • 20
  • did you read [this](http://stackoverflow.com/questions/10649379/hittestforeventinrectofview-is-invoked-twice-in-my-nsoutlineview-cells) – Anoop Vaidya May 23 '13 at 08:33
  • Yes, they have also mentioned that -(BOOL)trackMouse:inRect:ofView:untilMouseUp not getting called, but nobody gave any answer:(. And i am not using NSOutLineView here i am using this custom cell in my own custom control – Suhas Aithal May 23 '13 at 09:11

1 Answers1

0

Have a look at this example here https://github.com/mtavkhelidze/MTControlWithCell