Re: Application main menu title behavior change in 10.6

2009-09-08 Thread Jim Turner
On Fri, Sep 4, 2009 at 9:03 PM, Peter Ammonpam...@apple.com wrote:

 Hi Jim,

 First let me thank you for checking the release notes.  However, that
 particular issue is unrelated, confusingly enough.

 Here's what's going on.  The first menu item in the main menu (or more
 precisely, its submenu) is magic, in that when it becomes the first item,
 its title is ignored and instead the application name is used.  This is why
 you do not have to update your MainMenu.nib every time you change your
 application name.  In Leopard, there was a bug that caused this to be
 applied inconsistently.  It sounds like your application was benefiting from
 this bug.

 You can change the title of the application menu, after you set the main
 menu, like so:

 NSApp mainMenu] itemAtIndex:0] submenu] setTitle:@New Title]

 Hope this helps,
 -Peter



Indeed it does help, Peter. I now see why I was so confused with the
behavior I was encountering when I tried setTitle: initially.
setTitle: does its business only if the new title is different than
the current title. We are building a new main menu with the new
application's name already in place.

Doing the following sets the menu's title correctly when the title is
already set to New Title:

NSApp mainMenu] itemAtIndex:0] submenu] setTitle:@]
NSApp mainMenu] itemAtIndex:0] submenu] setTitle:@New Title]

Always appreciative of the help, Peter. Thanks!

-- 
Jim
___

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

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


Application main menu title behavior change in 10.6

2009-09-04 Thread Jim Turner
Hi all,

I have an application (QuicKeys) that allows the user to define menu
selection as an action. In our latest version and under Leopard, we
present UI that replaces the main menu bar of our app with the menu
bar of the target app (via setMainMenu:) so that we can correctly
retrieve which menu item the user selected. Works like a champ, even
under Snow Leopard, save for one problem.  Under 10.6, the application
name is always QuicKeys, not Finder or whatever the target
application name would be. This is causing confusion with our users as
while the menu is really the target app's menu, it has the wrong
application name.

Reading through the release notes for AppKit on 10.6, I found that
there's been a change to how the main menu bar displays the
application's name.  Specifically, under the NSApplication
application menu item title header, it states ... the application
menu always reflects the application name.  This appears to be what's
causing the issue and I'm curious if anyone knows of a work-around?

Thanks
Jim
___

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

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


Re: Application main menu title behavior change in 10.6

2009-09-04 Thread Steven Degutis
If that's indeed the case, then you're out of luck short of using a private
API in AppKit (which can be class-dump'd, by the way), which I would not
recommend. However, if you wanted, the way I would try it is by changing the
name of the application respective of the main menu, or at least look to see
if this is possible using private APIs in AppKit. But that's just me...
-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/


On Fri, Sep 4, 2009 at 1:31 PM, Jim Turner jturner.li...@gmail.com wrote:

 Hi all,

 I have an application (QuicKeys) that allows the user to define menu
 selection as an action. In our latest version and under Leopard, we
 present UI that replaces the main menu bar of our app with the menu
 bar of the target app (via setMainMenu:) so that we can correctly
 retrieve which menu item the user selected. Works like a champ, even
 under Snow Leopard, save for one problem.  Under 10.6, the application
 name is always QuicKeys, not Finder or whatever the target
 application name would be. This is causing confusion with our users as
 while the menu is really the target app's menu, it has the wrong
 application name.

 Reading through the release notes for AppKit on 10.6, I found that
 there's been a change to how the main menu bar displays the
 application's name.  Specifically, under the NSApplication
 application menu item title header, it states ... the application
 menu always reflects the application name.  This appears to be what's
 causing the issue and I'm curious if anyone knows of a work-around?

 Thanks
 Jim
 ___

 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:
 http://lists.apple.com/mailman/options/cocoa-dev/steven.degutis%40gmail.com

 This email sent to steven.degu...@gmail.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Application main menu title behavior change in 10.6

2009-09-04 Thread Peter Ammon


On Sep 4, 2009, at 11:31 AM, Jim Turner wrote:


Hi all,

I have an application (QuicKeys) that allows the user to define menu
selection as an action. In our latest version and under Leopard, we
present UI that replaces the main menu bar of our app with the menu
bar of the target app (via setMainMenu:) so that we can correctly
retrieve which menu item the user selected. Works like a champ, even
under Snow Leopard, save for one problem.  Under 10.6, the application
name is always QuicKeys, not Finder or whatever the target
application name would be. This is causing confusion with our users as
while the menu is really the target app's menu, it has the wrong
application name.

Reading through the release notes for AppKit on 10.6, I found that
there's been a change to how the main menu bar displays the
application's name.  Specifically, under the NSApplication
application menu item title header, it states ... the application
menu always reflects the application name.  This appears to be what's
causing the issue and I'm curious if anyone knows of a work-around?


Hi Jim,

First let me thank you for checking the release notes.  However, that  
particular issue is unrelated, confusingly enough.


Here's what's going on.  The first menu item in the main menu (or more  
precisely, its submenu) is magic, in that when it becomes the first  
item, its title is ignored and instead the application name is used.   
This is why you do not have to update your MainMenu.nib every time you  
change your application name.  In Leopard, there was a bug that caused  
this to be applied inconsistently.  It sounds like your application  
was benefiting from this bug.


You can change the title of the application menu, after you set the  
main menu, like so:


NSApp mainMenu] itemAtIndex:0] submenu] setTitle:@New Title]

Hope this helps,
-Peter

___

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

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