[Bug] Multiline element not generating events for pressing enter when enter_submits=True
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by running the provided tkinter reproduction and trace the Multiline handling for enable_events=True with enter_submits=True. Compare it with the working enter_submits=False case; done means pressing Enter generates an event while preserving the intended enter_submits behavior.
Written by the indexing model from the issue text.
Description
Type of Issue (Enhancement, Error, Bug, Question)
Bug
Operating System
Windows 11
PySimpleGUI Port (tkinter, Qt, Wx, Web)
tkinter
Versions
Python version: 3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]
port: tkinter
tkinter version: 8.6.12
PySimpleGUI version: 4.60.5
PySimpleGUI filename: c:\Users\XXX\venv\Lib\site-packages\PySimpleGUI\PySimpleGUI.py
Troubleshooting
- Searched main docs for your problem www.PySimpleGUI.org
- Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demos.PySimpleGUI.org
- None of your GUI code was generated by an AI algorithm like GPT
- If not tkinter - looked for Demo Programs for specific port
- For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
- Run your program outside of your debugger (from a command line)
- Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
- Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
- Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released
Detailed Description
The argument enter_submits=True in Multiline is not causing events to be generated upon hitting the Return key.
- When
enable_events=Trueandenter_submits=Falsethe Return key generates an event like all other key-presses. - When
enable_events=Trueandenter_submits=Trueno event is generated by the Return key. A new line is generated in the window.
Code To Duplicate
import PySimpleGUI as sg
def make_layout(enable_events: bool, enter_submits: bool) -> sg.Multiline:
value = f"{enable_events=}, {enter_submits=}"
return sg.Multiline(
value,
size=(20, 5),
enable_events=enable_events,
enter_submits=enter_submits,
key=value,
)
layout = [
[make_layout(False, False), make_layout(False, True)],
[make_layout(True, False), make_layout(True, True)],
]
window = sg.Window(
title="Various combinations of multiline options", layout=layout, finalize=True
)
while True:
event, values = window.read()
if event == sg.WIN_CLOSED:
break
print(f"Got event: {event}, with value: '{values[event]}'")
window.close()
Screenshot, Sketch, or Drawing
Neither of the multiline boxes in the right column generate events when the Enter key is pressed. The enable_events=True, enter_submits=False box in the lower left does.
Apologies if this is user error and not a bug.
Thanks!
- Dominant language
- Python
- Stars
- 13.8k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PySimpleGUI/PySimpleGUI
-
Bug Done - Install Dev Build (see docs for how) Platform Specific Issue - Linux Port - TK
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PySimpleGUI/PySimpleGUI#6904 · 15 comments ·
-
Bug Demo Programs Done - Install Dev Build (see docs for how) Interoperability Port - TK workaround available
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PySimpleGUI/PySimpleGUI#6900 · 1 comment ·
-
Done - Install Dev Build (see docs for how) enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
PySimpleGUI/PySimpleGUI#3251 · 12 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
PySimpleGUI/PySimpleGUI#6906 · 1 comment · 1 reaction ·
-
Bug Done - Install Dev Build (see docs for how) Port - TK
Difficulty 3/5 1-2 days Newbie friendliness 45/100
PySimpleGUI/PySimpleGUI#6902 · 1 comment ·
All issues in PySimpleGUI/PySimpleGUI
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·