3

I have a timer that counts down the seconds until an event, their is a label that I put in a status item item that displays that time. It's supposed to change each second. I first did all this in a normal window to make sure it all worked and it did. Then I turned it into a status item. The problem is that when the status item is selected and the dropdown menu is open, the label does not change, I would like for it to be constantly updating, not just updating while it is closed.

I know this can be done, because the stock battery status item can update the amount of time left until a full charge while the dropdown menu is open. I just can't find how to do it anywhere.

    [timeLeftLabel setIntValue:[timeLeftLabel intValue]-1];

that's the code I'm using in the timer selector, the label started with an initial value and simply counts down in 1 second intervals. If I open the status item, the label stops getting refreshed, it seems that while open, the label doesn't receive the +1 message. I don't think it's very complicated, but I've found very little documentation about this.

Thanks for the help.

Elbimio
  • 1,041
  • 2
  • 10
  • 25
  • 1
    Agreed, it's a dupe. @Elbimio, please don't use the term "menulet". The correct term is"status item", which is why the class that creates them is called `NSStatusItem`. – Rob Keniger Jul 08 '11 at 02:09
  • 1
    The link @Bavarious put got me the answer. I keept searching for "menulet" and "status item", so that one never showed up. Thanks a lot! – Elbimio Jul 08 '11 at 04:04

0 Answers0