Updating an NSPopUpButtonCell menu in an NSOutlineView
Updating an NSPopUpButtonCell menu in an NSOutlineView
- Subject: Updating an NSPopUpButtonCell menu in an NSOutlineView
- From: René Puls <email@hidden>
- Date: Mon, 6 Dec 2004 14:36:42 +0100
Hi,
I have an NSOutlineView where multiple columns have NSPopUpButtonCells
as their data cells. I want to have different popup menu contents when
the user clicks on a cell, depending on both row and column, but so far
I have been unsuccessful.
My first idea was to set a custom menu with a delegate for the cells,
but the menuNeedsUpdate: method is never called. (AppKit Bug?)
Then I saw that NSPopUpButtonCell broadcasts a
NSPopUpButtonCellWillPopUpNotification notification. So I registered as
an observer for this notification, which seems to work, but the
notification object is apparently random. Sometimes it is the same
object, even though I have clicked on a different column, and sometimes
it is a different object, even though I have clicked on the same
column. This makes it rather useless to me, because I need to know the
column and row for which I should update the menu.
Perhaps I could find the row and column by checking the [NSApp
currentEvent] coordinates; but this seems like an ugly hack to me. Is
there a better way to do this?
Kind regards,
René Puls
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden