after6ix

NativeWindow in AIR

NativeWindow is one of the two supported API for creating native operating system windows. The alternative would be going through the HTML-oriented JavaScript Window class.

With AIR, it is unusually easy to create windows that look like a standard desktop application and have them adopt the styling of the system chrome under the respective operating system. The APIs offer various options in the styling of the native windows, opening up options such as having window transparency, customized chrome, setting maximum and minimum dimensions, disabling resizing etc.

Very typically this is how a native window can be created from the main application:

package{
	import flash.display.*;
	public class App extends Sprite{
		private var window:NativeWindow;
		...
		public function App(){
			var opt:NativeWindowInitOptions = new NativeWindowInitOptions();
			opt.maximizable = false;
			opt.resizable = false;
			window = new NativeWindow(true, opt);
		}
	}
}

Simple as it is shown to create new native windows from the main application, I am still wondering how the main window of the application can be controlled. As documented, AIR automatically creates the first window for every application and the window is initialized based on settings defined in the application descriptor file.

The systemChrome, height, width, visibility and transparency can be set via that descriptor file.

What puzzles me is how to go about controlling the other options of the main application window. For example, is there a way to set the main window to be non-resizable like how it can be done with child windows created by the main application?

COMMENTS

Wed 13 Jun11:55 PM
sasha magee

sasha magee

This is not yet implemented. We plan on giving access to the other window initialization options through the application descriptor file. Just haven’t yet gotten there…

Fri 15 Jun04:57 PM
ronin

ronin

Hey Sasha, thanks for the clarification. Was really wondering how to go about setting the options for the main app window.

Fri 23 May10:59 PM
youtube

youtube

thanks it was good

LEAVE A COMMENT

Commenting is not available in this weblog entry.
COMMENTS HAVE BEEN CLOSED ON THIS ENTRY