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.

32 Responses to Constraining the Dimensions of an Apollo Application Window

  1. Faisal says:

    Cool, Looking like VB.net a little 😛

  2. Peter says:

    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? 🙂

  3. Phillip Kerman says:

    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.

  4. 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

  5. Peter says:

    Thanks Christian 🙂

  6. Rob Cifre says:

    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?

  7. Hikaye says:

    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”>HikayeAs 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.

  8. Sohbetx says:

    Thanks Christian |{^-_-^}|

  9. kapı says:

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

  10. Nice code.I hate previous code 🙂

  11. 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

  12. kale kapi says:

    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.

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

  14. oyun says:

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

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

  16. 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

  17. Canlı TV says:

    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.

  18. new pictures says:

    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;

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

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

  21. 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;

  22. kapi says:

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

  23. oyun says:

    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.

  24. hamachi says:

    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? :))

  25. Oyun says:

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

  26. Części Mazda says:

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

  27. Otel says:

    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

  28. 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?

  29. kelebek says:

    Is there a way to NOT show the resizable-arrows…

  30. Sohbet odaları says:

    thanks you 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?

  31. Kapicenter says:

    Is there a way to NOT show the resizable-arrows…

  32. canlı tv says:

    thnks I found one solution on the adobe forums like