-
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
Question - Select input on focus after enter #5407
Comments
It's about one month passed and almost all forgot. It looks like following code paste from your demo code, and the statement if event == 'Return':
user_event = window.user_bind_event
user_event.widget.tk_focusNext().focus()
user_event.widget.tk_focusNext().select=True
select=True Upgrade your PySimpleGUI from Github, then refer following link for new code |
Thank you Jason, I have the latest version PySimpleGUI 4.59.0 if event == 'Obj-Length' and values['Obj-Length'] and values['Obj-Length'][-1] not in ('0123456789.-'): and problem solved another way. |
Did I mess something up with this? 4.58.0 was when the new propagate parm was added to the bind methods as well as the addition of a bunch of new focus capabilities. |
Not sure what happened, however this piece below never worked if event == 'Return': so a clumsy workaround was to use if event == 'Return':
rinse and repeat for every element obviously adding an awful extra lines now the selection on enter works and because if user somehow deletes the default, calcs dont work, so as part of the event we restore the 0.00 elif event.endswith('FocusOut'): |
Then the other piece was the addition of |
Question - Select input on focus after enter
Operating System
WIN10 64
PySimpleGUI Port (tkinter, Qt, Wx, Web)
Versions
Python version: 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)]
port: tkinter
tkinter version: 8.6.12
PySimpleGUI version: 4.57.0
PySimpleGUI filename: C:\Users\LDS\AppData\Local\Programs\Python\Python310\lib\site-packages\PySimpleGUI\PySimpleGUI.py
Python version (
sg.sys.version
)PySimpleGUI Version (
sg.__version__
)GUI Version (tkinter (
sg.tclversion_detailed
), PySide2, WxPython, Remi)Your Experience In Months or Years (optional)
Years Python programming experience
Years Programming experience overall
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
Anything else you think would be helpful?
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
Detailed Description
@jason,
Hi Jason,
still struggling with selection on enter. In your comment in issues/5301 the following part of the code does not seem to work on my windows pc.
if event == 'Return':
user_event = window.user_bind_event
user_event.widget.tk_focusNext().focus()
user_event.widget.tk_focusNext().select=True
select=True
I thought the second select=true may be the culprit, then I moved the if block to a different position, but to no avail.
Would your time permit to have another look at this, thank you.
Code To Duplicate
A short program that isolates and demonstrates the problem (Do not paste your massive program, but instead 10-20 lines that clearly show the problem)
This pre-formatted code block is all set for you to paste in your bit of code:
# Paste your code here
Screenshot, Sketch, or Drawing
Watcha Makin?
If you care to share something about your project, it would be awesome to hear what you're building.
The text was updated successfully, but these errors were encountered: