« Using HTML and Script Bridging in Apollo | Main | Maptacular on Diggnation »

March 22, 2007

Constraining the Dimensions of an Apollo Application Window

I saw this issue come up on the Apollo forums the other day. If you want to constrain the dimensions of an Apollo application window, use the maxSize and the minSize properties of NativeWindow. I usually do it in an initialization function after setting the bounds of my window, like this:

var win:NativeWindow = systemManager.stage.window;
win.width = 800;
win.height = 600;
win.maxSize = new Point(800, 600);
win.minSize = new Point(800, 600);
win.visible = true;

You can also use the bounds property of NativeWindow to set its size and location at the same time.

Posted by cantrell at March 22, 2007 02:13 PM | References

Comments

Cool, Looking like VB.net a little :P

Posted by: Faisal at March 22, 2007 02:42 PM

I'm guessing the only way to do this in Javascript would be to use the onresize event, and then using the resizeTo method to attempt to keep the window at the size you want?

Or is there a better way? :)

Posted by: Peter at March 22, 2007 03:26 PM

Is there a way to NOT show the resizable-arrows... say I want to make the width fixed but height changeable... in that case I don't want the cursor change on the sides.

Posted by: Phillip Kerman at March 22, 2007 07:10 PM

Peter, we are looking at better solutions for future releases, but you're right that it's not easy to do currently.

Phillip, right now the grippers always show up, but that's something that should be fixed in future releases.

Christian

Posted by: Christian Cantrell at April 3, 2007 02:37 PM

Thanks Christian :)

Posted by: Peter at April 8, 2007 01:58 PM

I'm looking to try and center the main application window. Is there a way to do this? I found one solution on the adobe forums but that code didn't work, my application would load and then disapear.

Any ideas?

Posted by: Rob Cifre at May 16, 2007 12:27 AM

Your point is....?

In what way do the paranoid rantings of a blowhard right wing tv commentator compare to the threat represented by a US senator with subpoena power?
www.ihikaye.com" title="Hikaye" target="_blank">Hikaye
As for Chomsky, his paranoid rantings are no less offensive than O'Reilly's except that they are more interesting due to the magnitude of the intellectual resources he brings to the discussion. I wish he had stuck to generative grammar.

Posted by: Hikaye at August 1, 2007 12:05 AM

Thanks Christian |{^-_-^}|

Posted by: Sohbetx at August 5, 2007 02:04 PM

I'm looking to try and center the main application window.

Posted by: kapı at August 18, 2007 07:50 PM

Nice code.I hate previous code :)

Posted by: ingilizce kursu at August 19, 2007 06:03 PM

Is there a way to do this? I found one solution on the adobe forums but that code didn't work, my application would load and then disapear

Posted by: amerikan kapı at August 20, 2007 05:46 AM

Is there a way to do this? I found one solution on the adobe forums but that code didn't work, my application would load and then disapear.

Posted by: kale kapi at August 22, 2007 07:32 AM

thanks.. this information is a gold mine for me becouse i was getting mad about this problem and find a solution finally..Great work

Posted by: arama motoru optimizasyonu at August 26, 2007 05:13 PM

( Constraining the Dimensions of an Apollo Application Window ) very godd

Posted by: oyun at August 27, 2007 04:09 PM

I'm looking to try and center the main application window. !

Posted by: Bedava Oyun oyna at September 26, 2007 11:12 AM

Is there a way to NOT show the resizable-arrows... say I want to make the width fixed but height changeable... in that case I don't want the cursor change on the sides.this is good idea

Posted by: oyun siteleri at November 10, 2007 09:35 AM

Is there a way to NOT show the resizable-arrows... say I want to make the width fixed but height changeable... in that case I don't want the cursor change on the sides.

Posted by: Canlı TV at November 29, 2007 02:46 PM

O yeah thank you very good idea :)

var win:NativeWindow = systemManager.stage.window;
win.width = 800;
win.height = 600;
win.maxSize = new Point(800, 600);
win.minSize = new Point(800, 600);
win.visible = true;

Posted by: new pictures at January 1, 2008 10:09 AM

I'm looking to try and center the main application window. !
Thanks

Posted by: bedava oyunlar at January 26, 2008 04:34 PM

Is there a way to NOT show the resizable-arrows... Thanks Chritian

Posted by: varmısın yokmusun at February 3, 2008 05:50 PM

var win:NativeWindow = systemManager.stage.window;
win.width = 800;
win.height = 600;
win.maxSize = new Point(800, 600);
win.minSize = new Point(800, 600);
win.visible = true;

Posted by: laminat parke at February 17, 2008 03:56 AM

say I want to make the width fixed but height changeable... in that case I don't want the cursor change on the sides.

Posted by: kapi at February 18, 2008 02:07 AM

Is there a way to NOT show the resizable-arrows... say I want to make the width fixed but height changeable... in that case I don't want the cursor change on the sides.

Posted by: oyun at February 22, 2008 09:29 AM

I'm guessing the only way to do this in Javascript would be to use the onresize event, and then using the resizeTo method to attempt to keep the window at the size you want?

Or is there a better way? :))

Posted by: hamachi at April 6, 2008 07:09 AM

I'm looking to try and center the main application window.

Posted by: Oyun at May 8, 2008 05:42 AM

Really good article. Im use this script in my windows. Thanks

Posted by: Części Mazda at May 13, 2008 02:55 AM

Is there a way to NOT show the resizable-arrows... say I want to make the width fixed but height changeable... in that case I don't want the cursor change on the sides.this is good idea

Posted by: Otel at June 1, 2008 10:01 PM

Post a comment




Remember Me?



(you may use HTML tags for style)