2 Replies Latest reply on Jun 24, 2008 8:20 PM by Oliver Goldman

    dynamic system tray icon tooltips?

    normyee Level 1
      In AIR, can the system tray icon tooltip be dynamically generated?

      I want to dynamically display some data whenever the user hovers over system tray icon, but it doesn't appear I can do that with air.NativeApplication.nativeApplication.icon.tooltip ?

      for example, I tried to dynamically return the current date/time but it didn't work:

      air.NativeApplication.nativeApplication.icon.tooltip = function(){ return Date()};

      My other thought was to create my own custom "toolip" using NativeWindow when a user hovers over the systray (but would like to get it to work with air.NativeApplication.nativeApplication.icon.tooltip if possible)...any other suggestions/tips/thoughts?

      thanks
        • 1. Re: dynamic system tray icon tooltips?
          Joe ... Ward Level 4
          I don't believe this is possible. A better strategy may be to change the tooltip when the state of your application changes such that the text should be updated (rather than in response to a user event). However, I don't think the tooltip display will change while it is already open.

          Using a native window wouldn't work in this scenario, either. The difficulty is still detecting when the mouse is hovering over the icon. It is also not possible to definitely locate the icon on the desktop, although you can guess using the usableBounds property of the Screen class.
          • 2. Re: dynamic system tray icon tooltips?
            Oliver Goldman Adobe Employee
            It should be noted that the line of code you gave:

            air.NativeApplication.nativeApplication.icon.tooltip = function(){ return Date()}

            Sets the tooltip to a function, and *not* to the result of running the function. The latter is probably closer to what you're looking for.