AIR application on menu bar?

I am trying to find tutorials on getting my AIR application in the OSX menu while minimizing. However, when I try to find it, I get examples for this in the Windows system tray and Dock on macs. I do not want the application to remain on the dock when the window is not visible. I want it to collapse to the menu bar. Can anyone give me a hand? I don’t even know where to start.

EDIT: I don't want to find out about working with the OS X dock (at least in this post). I am interested in working with the menu. (See image below.) enter image description here

+4
source share
2 answers

It looks like you need to distribute your application as .dmg and include your own process. However, this should be possible, but you need to record the MacOS bit yourself. Check this out: http://www.adobe.com/devnet/air/flex/quickstart/articles/interacting_with_native_process.html

This is actually a pretty good tutorial on creating a status bar icon in OSX: http://www.sonsothunder.com/devres/livecode/tutorials/StatusMenu.html

+2
source

I don’t think that menu icons (OS system track icons in the Windows lexicon) are supported for OS X in AIR. You can check if this snippet works on your Mac:

if(NativeApplication.supportsDockIcon){ trace( "Dock icon IS supported" ); }else{ trace( "Dock icon IS NOT supported :(" ); } if (NativeApplication.supportsSystemTrayIcon){ trace( "System Tray icon IS supported" ); }else{ trace( "System Tray icon IS NOT supported :(" ); } 

As read on the Adobe support site:

"Application icons are supported on both Mac OS X and Windows, although the conventions for using these icons on each system are slightly different. On Mac OS X, the application icon is a dock icon and is represented by an AIR DockIcon object. On Windows, the icon an application is a system tray icon and is represented by an AIR SystemTrayIcon object. An icon object for your application is created automatically. The type of object is determined according to the operating system on which the instance of your application is running. "

More information and sample code here: http://www.adobe.com/devnet/air/flex/quickstart/articles/stopwatch_dock_system_tray.html

0
source

Source: https://habr.com/ru/post/1403601/


All Articles