NSStatusItem problem

  • Hi,

    I've got a problem in my applications.

    I use NSStatusItem with text only.

    Basicly something like that:

    NSStatusBar *statusbar=[NSStatusBar systemStatusBar];
    NSStatusItem* menuItem=[statusbar statusItemWithLength:-1];

    if (menuItem)
            {
            [menuItem retain];
            [menuItem setTitle:@"Test"];
            [menuItem setHighlightMode:YES];
            }

    the menu is created and I can click on it.
    Works nice in a stand alone Cocoa or Carbon application project.

    But in my applications which are made in Realbasic, this menu will
    install, but the clickable area in the menu is limited to the actual
    text. All the space between the letters can't be clicked.

    Has someone seen that before?

    Works in 10.4, so this is a 10.5 only issue.

    Gruß
    Christian Schmitz
  • You need to create your statusbar like so:

    NSStatusBar *statusbar = [NSStatusBar systemStatusBar];
    NSStatusItem *menuItem = [statusbar
    statusItemWithLength:NSVariableStatusItemLength];

    > Hi,
    >
    > I've got a problem in my applications.
    >
    > I use NSStatusItem with text only.
    >
    > Basicly something like that:
    >
    > NSStatusBar *statusbar=[NSStatusBar systemStatusBar];
    > NSStatusItem* menuItem=[statusbar statusItemWithLength:-1];
    >
    > if (menuItem)
    > {
    > [menuItem retain];
    > [menuItem setTitle:@"Test"];
    > [menuItem setHighlightMode:YES];
    > }
    >
    > the menu is created and I can click on it.
    > Works nice in a stand alone Cocoa or Carbon application project.
    >
    > But in my applications which are made in Realbasic, this menu will
    > install, but the clickable area in the menu is limited to the actual
    > text. All the space between the letters can't be clicked.
    >
    > Has someone seen that before?
    >
    > Works in 10.4, so this is a 10.5 only issue.
    >
    > Gruß
    > Christian Schmitz

    __________________
    Jesus De Meyer
    www.edot-studios.com
    jesus.edot-studios.com
    "creativity in mind"
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today