JMart 0 Posted March 4 Share Posted March 4 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 Link to post Share on other sites
comment 1,817 Posted March 4 Share Posted March 4 (edited) 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 by comment Link to post Share on other sites
JMart 0 Posted March 4 Author Share Posted March 4 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 Link to post Share on other sites
comment 1,817 Posted March 4 Share Posted March 4 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 Link to post Share on other sites
JMart 0 Posted March 4 Author Share Posted March 4 Your test file works perfect, my cant get it to work Link to post Share on other sites
JMart 0 Posted March 5 Author Share Posted March 5 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 Link to post Share on other sites
comment 1,817 Posted March 5 Share Posted March 5 (edited) 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 by comment Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now