-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[ Bug?] numeric input fields blocked on macOS after button running background task #5483
Comments
Does the tab key move focus around the window once in this state? Wondering if it's a problem of clicking on the input field and it getting focus or something related to focus. Can you also provide the specific version of tkinter like 8.6.12 perhaps? |
tab doesn't work either. It does not acivate anything
I also disabled the numeric checks on fields via the event, but that doesn't make a difference. From the main window I can open the Preferences window. When I open that and close it again, the fields somehow start working again. |
I think tkinter is losing the focus. It's behaving as if nothing has the focus. You're able to interact with some things like checkboxes I see, but not things that require the element to "have focus".
This sounds like it's giving the focus back to the other window. Do you have any tooltips? This is an area that has been tripping up tkinter in the past release.
You can do this yourself, in your event loop. That's the only "valid" place a new window can be created. I would try to set the focus on an element to see if tkinter will get back control that way. You can do this by calling |
When I wrote "do something that has the same efffect as opening & closing another window", I did not mean I want to open/close a window, but to simulate something like that as that does enable the text fields again. It has something to do with the focus. I use tooltips but they don't work on MacOS. I already knew that. I tried the set_focus() on several elements (the textfield, the tab, a button), but that doesn't help. |
Is your secondary window a popup or have "modal" set? |
It is a complete new window, but I don't set the modal boolean, so it should be modal=False by default. "main" Preferences function
And the layout/window function.
|
It's behaving perhaps like the focus is still on that other window. Can you try making it modal? I would normally flip the other way..... assumed you had modal set and then asked you to flip to it non-modal. There's a force focus flag on |
I thought you meant the preferences window. That is the window that I call and then close and then the fields function again. This occurs after the background jobs with the external commands have finished. The Thanks! EDIT: some more explanation. |
Thanks so far for your support. |
Of course! You are quite welcome... Thanks for your patience and smooth debugging. It's a great skill and a wonderful experience to work with someone that's got that gift. |
Type of Issue (Bug)
I do a number of actions and after having pressed a button that runs two background tasks, the numeric input fields don't work anymore.
This ONLY occurs in MacOS. On Linux Debian (10 and 11) and Linux Ubuntu 20.10, and on Windows 10 it simply continues functioning.
See screenshot and movie below
Operating System
MacOS Catalina
PySimpleGUI Port (tkinter, Qt, Wx, Web)
tkinter
Versions
Python version (
sg.sys.version
)3.10.0
PySimpleGUI Version (
sg.__version__
)PySimpleGUI 4.59 and 4.60
GUI Version (tkinter (
sg.tclversion_detailed
), PySide2, WxPython, Remi)tkinter 8.6
Your Experience In Months or Years (optional)
Years Python programming experience
8-10 occasional
Years Programming experience overall
30 years
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
PySide
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
Detailed Description
It is very difficult to share pieces of code, especially as I do not know why it does not work on MacOS, but does on several linuxes and Windows 10.
My github for PyImageFuser: https://github.com/hvdwolf/PyImageFuser
Code To Duplicate
Background function (from run_command.py):
My gui part for the numeric fields (from ui_layout.py):
My "keys" listening on the events on the numerical input fields (from the main PyImageFuser.py):
Screenshot, Sketch, or Drawing
Below a small movie
https://user-images.githubusercontent.com/4520361/169067165-35041829-de38-412c-b291-07741f5a290c.mp4
Watcha Makin?
From the Readme on my github:
PyImageFuser is a Python3 PySimpleGui program to exposure fuse bracketed images, reduce noise in stacks and do focus stacking. It uses align_image_stack and enfuse to accomplish this.
The text was updated successfully, but these errors were encountered: