Simple NSDatePicker query

2014-03-17 Thread jonat...@mugginsoft.com
Is it correct that a textual NSDatePicker can only display dates in short 
format ( dd/mm/ )?
Attaching a date formatter and setting say a long date format seems to have no 
effect.
 
Jonathan













___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Why is an IKImageBrowser method not firing?

2014-03-17 Thread Reinhard Segeler
1. Is the method really called? Log it...
2. Do you update the data source?
3. Is the data source reloaded after updating?

-- Reinhard 

Am 13.03.2014 um 22:07 schrieb David Delmonte:

> Hi all, I have a project that includes an NSSheet that displays images. The 
> data source methods to build the sheet are working fine. These are:
> 
> - (NSUInteger)numberOfItemsInImageBrowser:(IKImageBrowserView *)view;
> - (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(NSUInteger) index;
> 
> The images are loaded in a mutable array, and show and scale fine.
> 
> The method to remove an image is not firing:
> 
> - (void)imageBrowser:(IKImageBrowserView*)view removeItemsAtIndexes: 
> (NSIndexSet*)index;
> 
> 
> I've been scratching my head and now have splinters. Is there a way to access 
> a selected item in the mutable array? Why isn't the method firing?
> 
> Does anything come to mind that I can check? 
> 
> 
> Many thanks
> 
> David
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/macmeideln%40googlemail.com
> 
> This email sent to macmeid...@googlemail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Simple NSDatePicker query

2014-03-17 Thread Reinhard Segeler
Check the project "DatePicker" in the documentation. It should allow you, 
solving your problem.

-- Reinhard 

Am 17.03.2014 um 13:32 schrieb jonat...@mugginsoft.com:

> Is it correct that a textual NSDatePicker can only display dates in short 
> format ( dd/mm/ )?
> Attaching a date formatter and setting say a long date format seems to have 
> no effect.
> 
> Jonathan
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/macmeideln%40googlemail.com
> 
> This email sent to macmeid...@googlemail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Simple NSDatePicker query

2014-03-17 Thread jonat...@mugginsoft.com

On 17 Mar 2014, at 14:51, Reinhard Segeler  wrote:

> Check the project "DatePicker" in the documentation. It should allow you, 
> solving your problem.
> 
The textual pickers in the example project display as dd/mm/. So no 
solution that I can see.

J
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Getting the ImageBackground example to work on Mavericks

2014-03-17 Thread Sebastien Boisvert
I pulled out the older ImageBackground example (which shows a custom background 
image in a NSTableView/NSOutlineView) and am trying to make it work under 
Mavericks.
 
For the most part, it's working fine by explicitly disabling support for 
responsive scrolling. The only glitch that remains is expanding/collapsing 
items in the outline view - there's a visibile 'flash' that happens when the 
rows get added or removed (expand/collapse animations have also been disalbed 
for this), where the background it redrawn.
 
This worked fine under Lion/Mountain Lion, it's only under Mavericks that the 
glitch happens. I'm wondering if there's a way to avoid this as we use a 
similar technique in a view in our application.
 
P.S. for those unfamiliar with the example - it uses cell-based views.

Thanks for any insights.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: RSA and libcrypto

2014-03-17 Thread James Moore
I might as well post my gist for building openssl and lib crypto fat binaries 
in case someone wants a “build it once” solution

https://gist.github.com/foozmeat/5154962

It supports:

Mac: i386 and x86_64
iOS: armv7, armv7s, and i386. It will add arm64 and x86_64 support for iOS 7 
SDK (the default).

James

On Jan 25, 2014, at 11:49 AM, jonat...@mugginsoft.com wrote:

> 
> On 14 Jan 2014, at 09:42, Charles Srstka  wrote:
> 
>> On Jan 14, 2014, at 3:19 AM, jonat...@mugginsoft.com wrote:
>> 
>>> The only problem with retaining it is the extra complexity involved in 
>>> integrating the static library build into the project and upgrading the 
>>> source.
>> 
>> One trick that can help is that OpenSSL is in MacPorts, so you can just set 
>> up a symlink to the static library in /opt/local/lib, and then just run 
>> /opt/local/port selfupdate and /opt/local/port upgrade outdated every once 
>> in a while (or you can just set up a LaunchDaemon to run those commands 
>> periodically). This will keep your copy of OpenSSL and libcrypto up to date, 
>> at least.
>> 
> Took a while to get around to confirming this but I did use the MacPorts 
> approach - it was simply easier than building libcrypto from source within my 
> project (https://github.com/sqlcipher/openssl-xcode).
> It should be noted that lib crypto.a has a dependency on libz.a. -lz is 
> therefore required in other linker flags.
> 
> Jonathan
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/hello%40jmoore.me
> 
> This email sent to he...@jmoore.me



signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Animation on gesturing

2014-03-17 Thread Roland Bosa
I think something similar is described in the WWDC 2013 Video: “Custom 
Transitions Using View Controllers” (218).

On Jan 25, 2014, at 17:49, Eric Dolecki  wrote:

> The yahoo weather app does it for the iPad, you slowly swipe without 
> releasing and an animation is slowly moved through... It can be forward or 
> reverse. How exactly are they achieving that? Same goes for the iOS pull to 
> refresh animation for the stretched little do dad.
> 
> Thanks,
> Eric
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/rbosa%40logitech.com
> 
> This email sent to rb...@logitech.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

provisioning profile is ignored

2014-03-17 Thread Mike Kluev
i am signing my mac app with developers provisioning profile that
contains few uuids. then i am trying to run this app on the mac which
uuids is not included in the provisioning profile. i expect the app
fail to run, but it runs fine. am i missing something?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: EULA presentation requirements?

2014-03-17 Thread rick.langschultz

Doesn't ELLA stand for end-user LICENSE agreement, aren't such licenses 
prohibited per the clear language in the agreement as outlined? My rule,  if 
you have a question about it, don't. 

Sent from my Verizon Wireless 4G LTE Smartphone

 Original message 
From: Rick Mann  
Date:02/10/2014  7:53 PM  (GMT-06:00) 
To: Ken Thomases  
Cc: "cocoa-dev@lists.apple.com Dev"  
Subject: Re: EULA presentation requirements? 

Yeah, we found those. Thanks!

On Feb 10, 2014, at 17:51 , Ken Thomases  wrote:

> On Feb 10, 2014, at 7:39 PM, Rick Mann wrote:
> 
>> Ooops, sorry I wasn't clear. This is an iOS app (distributed through the App 
>> Store). I can't find similar language in
>> 
>> https://developer.apple.com/appstore/resources/approval/guidelines.html
> 
> Those say:
> 
>> • 10.1 Apps must comply with all terms and conditions explained in the Apple 
>> iOS Human Interface Guidelines
> 
> The HIGs 
> 
>  say:
> 
>> As much as possible, avoid displaying a splash screen or other startup 
>> experience.
> 
>> If possible, avoid requiring users to read a disclaimer or agree to an 
>> end-user license agreement when they first start your app.
> 
> So, those guidelines are not as cut-and-dry as the Mac App Store guidelines.  
> They provide sufficient wiggle room for your management to latch onto, if 
> they are determined.  But hopefully they discourage them from presenting an 
> at-launch EULA, instead.
> 
> Regards,
> Ken
> 


-- 
Rick



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Display selectd sub-menuItem in NSPopUpButton

2014-03-17 Thread John Joyce

On Feb 15, 2014, at 12:29 AM, Keary Suska  wrote:

> On Feb 14, 2014, at 5:02 AM, Leonardo wrote:
> 
>> I have filled my NSPopUpButton with menu and submenus.
>> 
>> When I select a menuItem on the root menu (so, not a sub-menuItem), it
>> propery displays the menuItem selected. And when I re-click on the popUp
>> button, I get the selected menuItem under the mouse.
>> 
>> But if I select a sub-menuItem, it doesn't display it. And if I re-click on
>> the popUp button, I don't get it under the mouse. Any time I click on the
>> button, I have to look for the selected item diving in the menu hierarchy.
>> 
>> Any solution? 
> 
> I basic problem is that NSPopupButton does not support submenus. You can get 
> the submenu item title to appear when the menu is dismissed but the side 
> effect is that the item will be added to the top menu. I didn't go any 
> further with that approach. It is too bad, because I would argue that there 
> are good use cases for hierarchical menus in popup buttons.
> 
> I don't have any real solutions, however, although I can suggest that you 
> could "hide" the side effect with a "recents" section of the menu. Otherwise 
> you will have to subclass NSPopupButtonCell and take over title and menu 
> handling, AFAICT.
> 
> HTH,
> 
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
> 


I was intrigued so I had to do a test app.
This is doable.
Not pretty, but very doable and without any subclassing.

Basically, you can create this with NSMenuDelegate, swapping menus for 
NSPopUpButton using setMenu: and a little recursion to force the issue of 
selection (or state in NSMenuItem terms) and lastly a little 
NSNotificationCenter.

You’ll need a reference (property or ivar) to your NSPopUpButton, to an NSMenu 
that will only display the selection, and to the NSMenu that will be your 
flyout enabled menu (a menu with submenus). You will also need an NSMenuItem 
property or ivar that will both help you know what should be selected when you 
swap menus and what should be deselected when you next display your flyout menu.

Here’s a simple app delegate interface and implementation to show you.


@interface MyAppDelegate : NSObject 

@property (assign) IBOutlet NSWindow *window;
@property (weak) IBOutlet NSPopUpButton *popUpButton;
@property (weak) IBOutlet NSMenu *selectionMenu;
@property (weak) IBOutlet NSMenu *flyOutMenu;
@property NSMenuItem *currentSelectedMenuItem;
@end


@implementation MyAppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
[_popUpButton setMenu:_selectionMenu];
[self 
addSelector:@selector(selectSenderAndMakeSelectionMenuShowSender:) 
toAllMenuItemsInArray:_flyOutMenu.itemArray];
[[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleNSPopUpButtonWillPopUpNotification:) 
name:NSPopUpButtonWillPopUpNotification object:_popUpButton];
}

- (void)addSelector:(SEL)aSelector toAllMenuItemsInArray:(NSArray *)items {
for (NSMenuItem *aMenuItem in items) {
if (aMenuItem.hasSubmenu) {
[self addSelector:aSelector 
toAllMenuItemsInArray:aMenuItem.submenu.itemArray];
} else {
[aMenuItem setAction:aSelector];
}
}

}
- (IBAction)selectSenderAndMakeSelectionMenuShowSender:(id)sender {
NSMenuItem *selectedItem = (NSMenuItem *)sender;
if (_currentSelectedMenuItem != nil) {
if (![_currentSelectedMenuItem isEqualTo:selectedItem]) {
[_currentSelectedMenuItem setState:NSOffState];
}
}

[selectedItem setState:NSOnState];
[self setCurrentSelectedMenuItem:selectedItem];

[_selectionMenu removeAllItems];
[_selectionMenu addItem:selectedItem.copy];
}

- (IBAction)popUpButtonAction:(id)sender {
NSLog(@"[%@ %@: %@]", self, NSStringFromSelector(_cmd), sender);
NSMenuItem *selectedMenuItem = [_popUpButton selectedItem];
NSLog(@" selectedMenuItem=%@", selectedMenuItem);
}

- (void)menuWillOpen:(NSMenu *)menu {
NSLog(@"%@", NSStringFromSelector(_cmd));

if ([menu isEqualTo:_selectionMenu]) {
NSLog(@" %@", menu);
} else if ([menu isEqualTo:_flyOutMenu]) {
NSLog(@" %@", menu);
}
}

- (void)menuDidClose:(NSMenu *)menu {

[_popUpButton setMenu:_selectionMenu];
}

- (void)handleNSPopUpButtonWillPopUpNotification:(NSNotification 
*)aNotification {
[_popUpButton setMenu:_flyOutMenu];
[self makeSureOnlyCurrentSelectedItemIsSelectedInMenu:_flyOutMenu];
}

- (void)makeSureOnlyCurrentSelectedItemIsSelectedInMenu:(NSMenu *)aMenu {
for (NSMenuItem *aMenuItem in aMenu.itemArray) {
if (aMenuItem.hasSubmenu) {
[self 
makeSureOnlyCurren

Re: NSNumber : method to return pointer to represented value

2014-03-17 Thread Mike Kluev
> I require an pointer to the value represented by an NSNumber.
> ...
> I am using NSNumber instances in collections as keys.

i may not fully understand your question, but can you not just use
NSValue valueWithPointer as your collection keys?
or, if a number at all, the number matching the pointer representation:
[NSNumber numberWithLong:*(ptrdiff_t*)&pointer]
or a string in a similar manner: [NSString stringWithFormat:@"%p", pointer];

in my experience resorting to tricks of objc_getAssociatedObject is
asking for trouble (e.g. the associated object is not released with
zombies).

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

How to create a Tags selection field in a dialog

2014-03-17 Thread Ben Staveley-Taylor
I’m considering making use of the Finder Tags functionality in Mavericks but 
the APIs seem a little sparse.

I want to create a UI with a field like the Tags: field on the Save As dialog 
so I can ask the user “Which tags do you want to use on files of this purpose?” 
This would not be at the point of saving the file, but in an application 
preference. (My application never opens or saves files; it is a file manager 
that just moves them around, so I don’t have a Save dialog.)

How can I ask the user to specify a tag, or set of tags, to use?

Ideally I would like to create new Tag string of my own (e.g. “MyApp To Do 
List”) but I can’t see any tag management API in NSWorkspace. Is it possible to 
do that, or even to enumerate what Tags are available and what colors they use?

Thanks

— Ben


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Finder Tags API

2014-03-17 Thread Ben Staveley-Taylor
I’m trying to understand the Finder Tags APIs in Mavericks.

I would like to set a custom Finder Tag on a number of files, ensure it appears 
in the Finder sidebar tag set, and assign it a color so the user can gather the 
files easily in the Finder. My application is a file manager and moves files 
around, but never actually opens and saves them so the user cannot explicitly 
assign Tags in a save dialog.

Let’s say I want to use “My Tag” as the tag string. I can assign a tag like 
this:

NSDictionary *dictTags = [item resourceValuesForKeys:[NSArray 
arrayWithObject:NSURLTagNamesKey] error:&error];
NSArray *arrPreviousTags = [dictTags valueForKey:NSURLTagNamesKey];
NSArray *arrNewTags = [arrPreviousTags arrayByAddingObject:@"My Tag"];
[item setResourceValue:arrNewTags forKey:NSURLTagNamesKey error:&error];

then “My Tag” shows in the Finder tags list, but with no color. I can’t seem to 
find much by way of a Tags API other than the NSURL NSURLTagNamesKey resources.

How can I assign a color to the tag “My Tag”?

I’d even settle for always using the standard Red tag, for example, but I would 
need to check that it exists in case the user has changed the default Tag set. 
And it might have a different name in other localizations. Can I enumerate all 
the Finder Tags that are available? The NSWorkspace labels don’t seem to be the 
same thing:

   NSArray *possibleTags = [[NSWorkspace sharedWorkspace] fileLabels];

always returns: None, Gray, Green, Purple, Blue, Yellow, Red, Orange, i.e. not 
my custom tag, nor even the standard “Important”, “Home” or “Work”.

Thanks,

— Ben.

(PS: I made a similar post a week or so ago but I don’t think it ever got to 
the list. Apologies if anyone gets this twice.)


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Saving while opening with NSDocument

2014-03-17 Thread Colas B
Hi (this is my first email on the Apple mailing list) ;-)

I would like to perform `saveDocument:` in the process of opening a document (I 
call this method in `- (id)initWithContentsOfURL:ofType:error:`.

It does not work because of a deadlock.

I would like to know if you have any idea about that.

PS: I also tried to override `(id)makeDocumentWithContentsOfURL:ofType:error:` 
and `- (void)openDocumentWithContentsOfURL:display:completionHandler:` (for 
this purpose, I subclass NSDocumentController. I have tried to call 
`saveDocument:` in "windowDidLoad". All lead to the same deadlock.

PPS: Why do I want to do that? When a document is opened, sometimes some 
corrupted data needs to be fixed. I do it, but I want to save these fixes. So 
that the user won't remark anything.

PPS: My document handles "additionalData" (file wrapper), but this should not 
change anything.

Thanks
Colas
`
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

menuNeedsUpdate for key equivalents?

2014-03-17 Thread Jim Prouty
Our app allows the user to write programs and to create custom menus and menu 
items, including setting key equivalents.

Because the key equivalents are under user control and because we re-use some 
for multiple purposes, menu items' key equivalents change a lot.

We need to get a chance to update/modify the menus and key equivalents *before* 
Cocoa starts looking for menu items that match the key equivalent.

At that time we need the ability to add/remove menus and menu items, set key 
equivalents, and enable/disable menu items.

menuNeedsUpdate: is an NSMenuDelegate Procotol that allows us to do exactly 
that when the user clicks in the menubar.


https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSMenuDelegate_Protocol/Reference/Reference.html

We'd love to have menuNeedsUpdate: be called before Cocoa starts calling 
menuHasKeyEquivalent:forEvent:target:action:.

menuDidOpen: is too late, according to the docs:

"Special Considerations: Don’t modify the structure of the menu or the 
menu items during this method."

Is there any way with OS X 10.6 and later to get this kind of advanced 
opportunity to modify menus and items for key presses?

Maybe some other class's delegate?

(Some our customers have 20 years worth of documents/programs which make rely 
on this feature, which Carbon's MenuSelect provides to this day.
That is, MenuSelect allows us to rebuild the menus for both key events and menu 
bar events.)

--Jim



Jim "How does it work?" Prouty

Voice: (503) 620-3001, FAX: (503) 620-6754
Makers of IGOR Pro, scientific data analysis and graphing for Mac and PC
http://www.wavemetrics.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

menuNeedsUpdate for key equivalents?

2014-03-17 Thread Jim Prouty
Our app allows the user to write programs and to create custom menus and menu 
items, including setting key equivalents.

Because the key equivalents are under user control and because we re-use some 
for multiple purposes, menu items' key equivalents change a lot.

We need to get a chance to update/modify the menus and key equivalents *before* 
Cocoa starts looking for menu items that match the key equivalent.

At that time we need the ability to add/remove menus and menu items, set key 
equivalents, and enable/disable menu items.

menuNeedsUpdate: is an NSMenuDelegate Procotol that allows us to do exactly 
that when the user clicks in the menubar.


https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSMenuDelegate_Protocol/Reference/Reference.html

We'd love to have menuNeedsUpdate: be called before Cocoa starts calling 
menuHasKeyEquivalent:forEvent:target:action:.

menuDidOpen: is too late, according to the docs:

"Special Considerations: Don’t modify the structure of the menu or the 
menu items during this method."

Is there any way with OS X 10.6 and later to get this kind of advanced 
opportunity to modify menus and items for key presses?

Maybe some other class's delegate?

(Some our customers have 20 years worth of documents/programs which make rely 
on this feature, which Carbon's MenuSelect provides to this day.
That is, MenuSelect allowed us to rebuild the menus for both key events and 
menu bar events.)

--Jim



Jim "How does it work?" Prouty

Voice: (503) 620-3001, FAX: (503) 620-6754
Makers of IGOR Pro, scientific data analysis and graphing for Mac and PC
http://www.wavemetrics.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com