Re: NSMenu not displaying items added programmatically
Re: NSMenu not displaying items added programmatically
- Subject: Re: NSMenu not displaying items added programmatically
- From: Patrick Hartling <email@hidden>
- Date: Thu, 10 May 2007 13:45:09 -0500
- Openpgp: id=C874F217; url=http://keyserver.veridis.com:11371/export?id=-4495319854773636585&created=1069733607000
I. Savant wrote:
> On 5/10/07, Patrick Hartling <email@hidden> wrote:
>> I am running into a problem with NSMenu where menu items that I add
>> throu=
>> gh
>> -insertItemWithTitle:action:keyEquivalent:atIndex: are never
>> displayed. W=
>> hat
>> I am trying to do is manual management of recently opened files. The
>> file=
>> s
>> being opened are not technically documents; they are configuration
>> files =
>> for
>> the software. From reading about NSDocumentController and NSDocument, it
>> seemed that these were not appropriate for my case.
>
>
> How about letting the document controller do things its own way by
> using its Open Recent menu-related methods:
>
> http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSDocumentController_Class/Reference/Reference.html
>
>
> – maximumRecentDocumentCount
> – clearRecentDocuments:
> – noteNewRecentDocumentURL:
> – noteNewRecentDocument:
> – recentDocumentURLs
I will look at NSDocumentController again. I am not opposed to using it, but
it seemed as though I would be working against its expectations by not
actually having documents associated with windows.
Nevertheless, there must be some reason that the menu changes that I am
making are not showing up. I have seen examples of constructing menus
programmatically, and since the API exists for doing it, it seems that
people should be able to use it. I can only conclude that I am missing
something simple, and it would be very educational to know what that it.
-Patrick
--
Patrick L. Hartling
VP Engineering, Infiscape Corp.
http://www.infiscape.com/
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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