March 4, 20214 yr Good day, I am trying to center a "Floating Window" using the new windows command, i want to accomplish one of two objectives. 1- Open the new windows to the right of the "button" that triggers the script To do this i am using the "GetLayoutObjectAttribute( "VendorWindows" ; "Top" ), and "GetLayoutObjectAttribute( "VendorWindows" ; "Left" ) 2- Open the new window in the center of the screen To do this i am using "Get ( ScreenWidth ) /2" and "Get ( ScreenHigh) / 2" But i cant get either way to work. Both option i am entering it in the "New windows" function What am i doing wrong. Thanks JMart
March 4, 20214 yr 1 hour ago, JMart said: What am i doing wrong. Hard to say without seeing exactly what you did. Also the description "i cant get either way to work" is pretty useless. Tell us how it fails. The only thing that jumps out is this: if you want to open a floating window to the right of the button, then you should specify its position from left as = GetLayoutObjectAttribute ( "YourButtonObjectName" ; "right" ) Oh, and also, if you want to center the window, you must subtract half of its intended width from the screen center in order to get its position from left. Likewise for the vertical dimension. Edited March 4, 20214 yr by comment
March 4, 20214 yr Author Thanks for the reply, User Click on the icon next to "Vendor" Once presses a script is executed Windows will appear on the same location every time
March 4, 20214 yr I am afraid I am not able to reproduce the problem you describe. The only thing I can think of is that your button's object name is not "VendorWindow". Does the attached demo work as expected for you? NewWindowPos.fmp12
March 5, 20214 yr Author Night, I think i figured out the issue i was having, the reason is my button was not a button but a Button Bar. I recreated it to a button and its working fine. Thanks for the help
March 5, 20214 yr 1 hour ago, JMart said: the reason is my button was not a button but a Button Bar. I don't see why this should be a problem (see attached). Note that a button bar is an object by itself and so are the individual buttons. The only way I was able to reproduce a behavior similar to what you describe was when neither the bar nor any of its buttons had an object name equal to the one used by the script. NewWindowPos2.fmp12 Edited March 5, 20214 yr by comment
July 20, 20214 yr Author Hi, I think i figured out what my issue is. It seem it has to do with the screen resolution and scale. I use a laptop and the setting are "Scale and Layout" to 125%, with a resolution of 1920 x 1080. if i put the scale to 100% it works fine. Even centering a window does not work. Thanks Rudy Edited July 20, 20214 yr by JMart
Create an account or sign in to comment