vinnygi Posted February 17, 2020 Share Posted February 17, 2020 I'm pretty sure the answer is no, but is there a way to capture the position of a window so that I can do a script that will snap it back to its original position when a user moves it? As far as I know, there are no script triggers that can run when a window is moved, just changed (dimension, mode, etc.) Link to comment Share on other sites More sharing options...
bcooney Posted February 18, 2020 Share Posted February 18, 2020 This is the first I’ve heard such a request. What’s the use case? Why do you care that the user moved the window? Link to comment Share on other sites More sharing options...
vinnygi Posted February 18, 2020 Author Share Posted February 18, 2020 Good question... I have a window acting as a kind of launcher with buttons. It's only 100 pixels wide. Some of the buttons have popup windows that in turn open a card window that is much larger. Since a new card window is based on the parent, I've done some convoluted math to make sure it appears on the screen near the main window. The problem is, if the user moves the main window, the card may end up off the screen with no way to interact with it. That's why I want to move the main window back to its original location if they move it. I have set a script step that moves the main window when the card window is opened, but that doesn't prevent them from moving it after the card appears. Link to comment Share on other sites More sharing options...
comment Posted February 19, 2020 Share Posted February 19, 2020 21 hours ago, vinnygi said: I've done some convoluted math to make sure it appears on the screen near the main window. The problem is, if the user moves the main window, the card may end up off the screen with no way to interact with it. Can't you use some more "convoluted math" to prevent this from happening? Link to comment Share on other sites More sharing options...
Josh Ormond Posted February 19, 2020 Share Posted February 19, 2020 Spawn a regular window off-screen. Pop the card window from that. Then the user can't move. It will need to be based on it's own file, or the user won't be able to do anything else with any window. Generally, I'm not a fan of forcing things on the user, unless absolutely necessary. So you will need to consider if that's really necessary vs just having a floating window they can place where they want. You may also need to do some dancing to make sure scripts don't inadvertently take over that launcher window. A separate file can go a long way in making that management easier. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 1537 days old. Please don't post here. Open a new topic instead.
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