CPMenu problems #1222

Open
nxn opened this Issue Apr 11, 2011 · 8 comments

Projects

None yet

6 participants

@nxn

Sample code:

@import 

@implementation AppController : CPObject
{
}

- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
  var myApp  = [CPApplication sharedApplication]
    , myMenu = [myApp mainMenu]
    , menuItem = [[CPMenuItem alloc] initWithTitle:@"Item" action:nil keyEquivalent:nil];
  
  [myMenu addItem:menuItem];

  [CPMenu setMenuBarVisible:YES];
}

@end

Two problems:

  • addItem puts the newly added item on the right side of the menubar (there seems to be a separator at index 4).
  • The 'Save' submenu only shows up sporadically and with a delay after the initial click. There also seem to be some display issues occasionally if the submenu is on the right. This behavior was the same in every browser I tested, namely: Opera 11.01, Firefox 4.0, and Chromium 10.0.648.204.
@tolmasky
Cappuccino member

At least in terms of it showing up on the right, that is expected behavior. At some point we may change the APi for left/right menus.

@Me1000

Why is this expected? Cocoa does not throw them on the right side does it?

@cappbot

Label: #new. What's next? A reviewer should examine this issue.

@ggsato

+bug
+AppKit
+#needs-confirmation

@cappbot

Labels: #needs-confirmation, #new, AppKit, bug. What's next? This issue needs a volunteer to independently reproduce the issue.

@ahankinson

The issue is not that it throws the menu item to the right of the other items, but that it places it on the right side of the menu bar.

This is still a problem with the latest master.

Note that this only seems to work with non-NibApplication apps. That is, adding the above code to a NibApplication will correctly place it to the right of the menu items.

The Cocoa documentation says:

"addItem:
Adds a menu item to the end of the receiver."

Which I would take to mean that it adds it to the end of the list of menu items, not to the right-hand side of the menu.

I've created a reduction for this: https://dl.dropbox.com/u/1996023/capp/Issue2222-2.zip

+#accepted
+#needs-patch

@cappbot

Labels: #accepted, #needs-patch, AppKit, bug. What's next? This issue needs a volunteer to write and submit code to address it.

@cappbot

Milestone: Someday. Labels: #accepted, #needs-patch, AppKit, bug. What's next? This issue needs a volunteer to write and submit code to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment