I'm creating an app that controls/connects to a 3G usb modem and right now I'm setting up the way that it reads the signal, but when it updates/sends the action it creates another menulet until my menu bar is full, how can I make it update the existing image?
Here's how I'm doing it and it works good for the large images inside the main window. The reason the images are titled fivemenubars and such is because I already used fivebars elsewhere.
Here's how I'm doing it and it works good for the large images inside the main window. The reason the images are titled fivemenubars and such is because I already used fivebars elsewhere.
Code:
if (calculatedSignal < -106) {
[statusItem setImage:(NSImage *)onemenubar];
}
else if (calculatedSignal < -98) {
[statusItem setImage:(NSImage *)twomenubars];
}
else if (calculatedSignal < -90) {
[statusItem setImage:(NSImage *)threemenubars];
}
else if (calculatedSignal < -82) {
[statusItem setImage:(NSImage *)fourmenubars];
}
else if (calculatedSignal > -82) {
[statusItem setImage:(NSImage *)fivemenubars];
}