Re: Dynamic menu for document-based app?
Re: Dynamic menu for document-based app?
- Subject: Re: Dynamic menu for document-based app?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Wed, 19 Jan 2005 14:28:33 +0100
At 14:39 Uhr -0800 18.01.2005, Keith Blount wrote:
For 1), I guess I could use add notifications to every
data source method that changes data, but this seems
somewhat clunky. Or I could go through my code and
make sure the menu gets updated every time I call
reloadData on the outline view - again, a little
clunky, maybe.
Or, if your menu doesn't have keyboard shortcuts, you could
dynamically populate the menu whenever the user opens it. You'd still
need to keep around a change count so you know when the menu is
current and when you need to reload it from the data source, but if
your users never use the menu, they won't incur the overhead.
For 2), the only thing that looked helpful in
NSApplication's documentation was maybe using [[NSApp
orderedDocuments] objectAtIndex:0] to work out which
data source to show in the menu, though I would have
thought there would be a better way... Also, I would
need to know whenever the active document changes.
Have a look at the First Responder. Just implement a
getFirstDocumentsOutlineList: method and send that to the first
responder. disable your menu when there is no first responder that
accepts the message, populate it with the list's contents otherwise.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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