This example displays a input window at a position of 675 from the left.

winMargins = {{675, Automatic}, {130, Automatic}};  
InputString["testing WindowMargins!  stop: 0", 
    FieldSize -> Small, WindowMargins -> winMargins];

I want to display the window centered horizontally on the screen. I tried to use the following, but it does not work.

winMargins = {{Scaled[{0.5}], Automatic}, {130, Automatic}};  

How can I get a horizontally centered input window?


In Version 7 on Windows 7 this configuration appears to produce a horizontally centered window:

winMargins = {{Automatic, Automatic}, {130, Automatic}};
  • $\begingroup$ Works in v8, v9 (Mac) too. $\endgroup$ – Michael E2 Jul 26 '13 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.