Hi, I am trying to find the fastest way to move a window to the center of the users display.
Modal windows automatically are centered on the screen, so I know that JMP is somehow able to tell where to put a window, but I have only found some relatively slow workarounds to doing this with non-modal windows. Below is the jsl script I am currently using to determine the screen size and center a new window.
Is there a faster way? Thanks!
win2 = NewWindow("Test Window");
winSize = win2 << GetWindowSize();
win2 << ShowWindow(0);
testwin = NewWindow("test", << ShowWindow(0));
testwin << Maximize Window(1);
dispsize = testwin << Get Window Size;
testwin << CloseWindow();
win2 << MoveWindow(dispsize[1]/2 - winsize[1]/2, dispsize[2]/2 - winsize[2]/2);
win2 << ShowWindow(1);