user1081056
user1081056

Reputation: 533

Air javascript set NativeWindow alwayInFront

How set air window with javascriupt or configuration to be always on top? How i found in documentation, i need to set only property (boolean)(NativeWinow.AlwaysOnTop) to "True".

But when im using it nothing happens. And this code:

for (var i in air.NativeWindow)
   air.trace(i)

show me nothing.

Upvotes: 0

Views: 144

Answers (1)

James
James

Reputation: 979

I think you are trying to iterate through the opened windows and then set the window you require to always be on top, and you want to do this using javascript correct?

This is pseudo type code and hasn't been tested, but looking at the NativeWindow HTML Reference and the NativeApplication HTML Reference you could try something like this:

for(var i =0; i<NativeApplication.nativeApplication.openedWindows.length; i++)
{
   var window =  NativeApplication.nativeApplication.openedWindows[i];

   //do some comparison to see if this is desired window
   if(window == window_I_want)
   {
      window.alwaysInFront = true;
      break;
   }
}

The only caveat here is that you must include the AIRAliases.js script in your application:

<script src="AIRAliases.js" /> 

Upvotes: 1

Related Questions