Re: How to make the Contextual Menu on the tableview's empty rows unable?
Re: How to make the Contextual Menu on the tableview's empty rows unable?
- Subject: Re: How to make the Contextual Menu on the tableview's empty rows unable?
- From: Graham Cox <email@hidden>
- Date: Thu, 23 Jul 2009 13:12:25 +1000
On 23/07/2009, at 1:03 PM, Bright wrote:
Hi everyone:
In the "Controller" class, I used the code as follows to
finished the contextual menu
on the table view. And I succeeded.
[]
Now I hope the contextual menu disappears in the empty rows. And it
is only valid in the
rows which hold data. But I don't know how to implement the purpose...
Any help greatly appreciated.
The menu is attached to the table view, so will appear no matter where
you click.
You could override -menuForEvent: and check the mouse location against
the rows and return nil for empty rows, or invoke super for populated
rows. But that means subclassing the table.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden