Search code examples
macostooltipdelaynsstatusitem

NSStatusItem tooltip – change delay


I have a NSStatusItem to which I've added a tooltip using the setToolTip: method.

Everything works, except that the delay before showing the tooltip seems to be about 3 seconds, which is not ideal for my application.

Is there a way to change the delay before the tooltip is shown? Ideally, I'd like the delay to be 0 (i.e., the tooltip is immediately displayed when the user hovers over the icon).


Solution

  • Try this

    [[NSUserDefaults standardUserDefaults] setObject: [NSNumber numberWithInt: 1]
                                              forKey: @"NSInitialToolTipDelay"];