cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Command to Move Window Relative to Display Size

Hi.  I'd like to see a command that could move a window relative to the display size.  That is, if I want to move a window to the center of my display, the command might look like:

 

win << Move Window Relative(0.5, 0.5)

 

If the user has multiple displays, the command would assume the current display is being used.

 

Currently, if I want my script to center a window:

1. Create a dummy window that is assumed to be larger than any display (10k x 10k).

2. Get the resulting window's actual size.  This is assumed to be the size of the user's display.

3. Close this window.

4. Now create the intended window and get its size.

5. Compute the desired new window upper-left corner coordinates using the display size and window size.

6. Move the new window using the << Move Window command.

 

I find that it helps to improve the users' experiences with the tools I'm developing if my windows always appear in the same place when they use it, rather than changing locations each time.  Not being able to predict the users' display sizes necessitates the steps above however.

3 Comments
Status changed to: Acknowledged

Hi @nikles, thank you for your suggestion! We have captured your request and will take it under consideration.

 

hardner
Level V

@nikles that is a clever way to get the display size.  I would just add to this that it would be nice to have a command to learn the display size and also that it can be complicated if the user has more than one screen.  Ability to learn the relevant info about any screens and use it locate a window would be great.

nikles
Level VI

@hardner Thanks!  I've found that my method finds the size of the screen in which JMP was initially opened.  So if the user has multiple screens (as do I), and they move the windows to the other screen, my method still assumes the original screen.  This is an annoyance, but manageable.  Yes, I agree it would be nice to have a built in command to do this automatically.