Right now there isn't a way to set the position programmatically. I guess I could make it settable. However, it should be picking the first monitor and centering the window there. Could you post the output of get(0,'MonitorPositions')?
I have a problem displaying the splashscreen, as I have two monitors set as "extended" display. Once the SplashScreen runs, the screen shows "in the middle" of the two monitors, i.e., half of the splashscreen is in Monitor A and another half in Monitor B.
Is there any setting to position the splashscreen on the monitor?
OK, that's a little surprising. Maybe try putting a "drawnow" after opening it?
You are right that nothing will be shown until the MCR has been loaded/initialized. The only way around that is to write a wrapper around your executable that shows the splashscreen before launching the MATLAB deployed app. Obviously that would have to be written in something other than MATLAB (which requires the MCR!).
I am trying to use this for compiled programs and hope this will show up soon after the program icon is clicked. In general, it will take a while before anything can happen on the screen, probably because MCR has to be loaded. In my case, the program also goes to look for the paths of file I/O that are saved from the previous session. When I call this in the _OpeningFcn(), it did not show up until close to the end of waiting time. Wonder if there is a solution for it?
Hi Canoe Commuter (great name, by the way - beats using the car!), the simple way to make the splashscreen stay up for a second or two is to use "pause(1)" (for 1 second) or similar. However this will block, not allowing anything else to happen, which may get annoying.
A slightly more sophisticated approach is to ensure it stays up for N seconds. In psuedo-code this might look something like:
showSplashForSecs = 2;
timer = tic;
elapsedTime = toc(timer);
if elapsedTime < showSplashForSecs
pause(showSplashForSecs - elapsedTime);
This should ensure that the splashscreen is always on for at least two seconds even if your application initializes really quickly. It will still block interaction whilst paused though.
Hi Andre, you must call this with a name for the window (i.e. a title) and the name of the image file you want it to show. For example: "s = SplashScreen('My App','myAppImage.png')". Type "help SplashScreen" for more information. If that still doesn't help you, let me know.
Only one remark about figure position.
On my computer, root 'MonitorPositions' return [left,bottom,right,up] for each monitor instead of [left,bottom, width, height] as described in the matlab documentation.
so, I had to replace line 247 & 248 by those:
x0 = pos(1,1) + (diff(pos(1,[1 3]))-obj.Icon.getIconWidth())/2
y0 = pos(1,2) + (diff(pos(1,[2 4]))-obj.Icon.getIconHeight())/2
Note that this is not an issue if you use only one monitor or if your primary monitor is on the left of the secondary.
Hi Dani, an update allowing the text shadows to be turned off is on its way. I don't think the Java tools I'm using allow animated GIFs to be viewed, so I don't think that can be supported in any easy way.