-
1 Mar 2013 9:40 AM #1
Unanswered: Initial window open at the lower left corner on OS X
Unanswered: Initial window open at the lower left corner on OS X
When I double click on the packaged executable on OS X, the initial window seems to always open at the lower left corner of the window. Is there a way to open it at the center of the screen and to customize the dimension of the main window? Thanks.
-
5 Mar 2013 9:45 PM #2Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
- Answers
- 20
The recommended approach is to keep the window hidden (have autoShow be false) and then you can set up the window dimensions and position prior to calling show() for the first time. Something like this:
Code:var win = Ion.ui.mainWindow; win.setDimensions(1024, 768); win.center(); win.show();
-
6 Mar 2013 4:15 AM #3
Thanks @jarrednicholls. Is it possible to make it the default behavior, or to make it configurable in the packager json file? My reason is that I want to minimize the dependencies on the ion api. I'm hoping to share as much code as possible with my browser version.
Thanks.
-
6 Mar 2013 1:38 PM #4Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
- Answers
- 20
Unfortunately not at this time, the autoShow is the only option available in the mainWindow settings. We have intentions to extend the mainWindow settings however for sure. I'll attach this thread to a ticket so it can be tracked.
In the meantime, you can use the common web tactic of feature detection to detect if Ion API is present, and if so, take advantage of it. Your code will be portable and adaptable...this is extremely common and happens in every web application, so don't think of this as being "hacky"...it's deliberate.
Thanks!Code:if (typeof window.Ion !== 'undefined') { var win = Ion.ui.mainWindow; win.setDimensions(1024, 768); win.center(); win.show(); }
You found a bug! We've classified it as
ION-1056
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.




Reply With Quote