-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remember last sketch window position #60
Comments
I'm thinking that the editor might handle this (Thonny, in this case). So, |
So I've been running py5 Sketches for almost 2 years go (I started in March of 2020) and just about every time I've moved the Sketch window to a new location after it opens up. I never thought about this until you asked about it. I agree, it would be nice if the Sketch window would "remember" its last location and open up new windows in the new location. This is how most other applications work. I wonder if this is managed by the OS or by each individual application. In any case, here is what I know about Sketch window locations.
If you look at the Processing code comments they specifically mention this is used to set the window location by the editor. So in the case of Processing, window location is in fact actively managed by the PDE. I know little about Processing code outside of the core libraries. But I was able to find the More investigation is needed here. Are py5 Sketches currently attempting to report window locations to a socket that nobody is listening to? First we need to find the code in the Sketch that is reporting the window location and how that communication channel works. Then we need to get the Thonny plugin to receive those messages. Currently the |
All of this work is done and will now remember the screen location of the last Sketch. The Processing uses the
The window positions will be outputted to stderr and will be preceded with MOVE. The PDE must be intercepting these messages and removing them from stderr before displaying stderr to the user in the output pane. If it is not easy for you to do the same in Thonny let me know; py5 could easily write the window positions to a socket instead. |
With the Processing editor, you can run a sketch, then move the display window about; py5, of course, does this too.
But, with Processing, rerunning the sketch positions it where you last closed the display window; the py5 display window always defaults to the center of the screen.
One can set the window position explicitly with
set_location()
, but might there be a way for py5 to recall the last coordinates?The text was updated successfully, but these errors were encountered: