StatusItem OSX

Ne das hatte keinen Effekt, erst als ich eine Klasse mit Eventhandler erstellt habe, konnte ich die Buttons klicken.

Excuse me, gentlemen, what about pursuing your conversation in the appropriate Deutsch channel ? Thank you.

Sorry. Sometimes this happens.

[quote]@Axel Schneider: here is an Example , replace TextAreaIcon with your icon
and replace in Window1.open
Cocoa.StatusItem self, TextAreaIcon, nil , “”
TextAreaIcon with the name of your icon (and “” with a Text if you need )[/quote]

Is it possible to swap the icon for another image dropped onto a canvas, and then reset it back to the original upon window close?

I originally had this working, but the new framework seems to have broken it. I am now trying to find the best way to recreate it using new code.

Thank you all in advance.

have changed the Example

drop an image to the Canvas

@Axel Schneider,
Thank you very much Axel - that is very similar to what I originally had.

I have had to change the (20,20) image size in the actual code to (16,16) - otherwise dropped images were extremely blurry (at least on a non retina monitor).

One last question - what button code would I need to return the image back to the default start image?
I put the following code in a RESET button, but that added a second icon in the status bar.

Cocoa.StatusItem apple16, nil , ""

Thanks.

use

Cocoa.changeStatusImage yourimagename

Thank you Axel!

the quality of the scaled Picture is much better using ‘Image Events’,
see statusitem2 in Example

Sorry to hijack this old thread @Christian Schmitz but following the video example I can’t get the menu items to be enabled. They show up and I can toggle their state but even setting the menu items Enabled = True has no effect. The whole menu is disabled. Has there been a change? Using macOS Sierra.

Spoke to soon. Look like the items get enabled when you subclass them and implement the Action event. They’re greyed out until you do that.