im trying to get an desktop app with a status item…so i tried macoslib, but there are about 100 errors i put the folder macoslib on my project. And this lib is so big i dont want so much crap in my app.
is there an lightweight and good way to handle a status item?
[quote=182895:@Dave S]Just what is supposed to happen with that example?
I downloaded it, ran it … and got a window with nothing special visible[/quote]
CreateMenu call was removed as it’s not necessary any longer.
you can assign an image and NSImageMBS class has various ways to be created. From a Xojo picture, from a file, from data in memory. Just check the documentation.
Danke nach einem Kaffee hatte ich das dann auch schon selber verstanden
Was mir allerdings noch nicht klar ist, die MenĂĽpunkte sind deaktiviert, also man kann sie nicht klicken. Im Beispiel wurde einer mit dem state aktiviert, das scheint ihn aber nicht mehr sonderliche zu interessieren.
statusitem = New NSStatusItemMBS
dim statusimg as new NSImageMBS(synoSync_icon_16)
if statusitem.CreateMenu then
statusitem.image = statusimg
statusitem.HighlightMode = true
menu = new NSMenuMBS
dim item as new NSMenuItemMBS
item.CreateMenuItem
item.Title = "#options"
item.Enabled = true
item.state = 1
menu.addItem item
items.Append item
item = New NSMenuItemMBS
item.CreateMenuItem
item.title = "#quit"
menu.addItem item
items.Append item
statusitem.menu = menu
else
MsgBox "This APP requires Mac OSX 10.3 or newer!"
end if