Jump to content
Server Maintenance This Week. ×

"Lock" window position...


This topic is 1537 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

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

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

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.

  • Thanks 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.