Bug Found from PySimpleGUI spin element
还没有人认领这个 Issue。
评估
调研方向
Start in the main init.py file at the Spin element's ChangeSubmits handling, then inspect _SpinboxSelectHandler and _SpinChangedHandler. Reproduce the issue by holding a spin arrow and releasing it; done means the final value is captured and the corresponding event is fired without another click.
由索引模型根据 Issue 内容生成。
描述
Windows 10
FreeSimpleGUI / PySimpleGUI
The issue is with the sg.Spin element when holding down either up or down arrows buttons continuously.
When you release the mouse button or , the final value would of not been captured internally unless i suppose you do an additional write_event_value or whatever.
sg.Spin(
values=[i for i in range(21)],
size=(2, 1),
font="Arial 9",
background_color=bgc,
enable_events=True,
readonly=True,
k="Lockout",
p=((8, 0), (30, 0))
)
in my code im busy with i cannot click additional time to get the final value using element.get()
So here if i start the default value as 5 and then hold down mouse button on the up arrow button in the spinbox.
When it reaches 20 and i let go the mouse button, i dont get the value 20 from call element.get() and infact while holding down the mouse button there are no more events fired for the spinbox.
They guys from PySimpleGUI actually had the correct code but then messed it up.
In the main __init__.py file find under element spin
if element.ChangeSubmits:
element.TKSpinBox.configure(command=element._SpinboxSelectHandler) ----- This needs to be commented out
# element.TKSpinBox.bind('<ButtonRelease-1>', element._SpinChangedHandler) --- enable this again but use _SpinboxSelectHandler
# element.TKSpinBox.bind('<Up>', element._SpinChangedHandler) --- leave as is
# element.TKSpinBox.bind('<Down>', element._SpinChangedHandler) ---- leave as is
For me doing this fixed the spinbox.
Also this internal method _SpinChangedHandler from the class Spin is pointless at the moment as it does not get called anywhere because they changed to using _SpinboxSelectHandler.
- 主要语言
- Python
- 星标
- 867
- 派生
- 106
- 平均合并
- 1 分钟
- 30 天内合并 PR
- 2
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
spyoungtech/FreeSimpleGUI 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
spyoungtech/FreeSimpleGUI#109 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
spyoungtech/FreeSimpleGUI#86 · 1 条评论 · 2 个 reaction ·
-
难度 1/5 1 小时以内 新手友好度 58/100
spyoungtech/FreeSimpleGUI#101 · 8 个 reaction ·
-
难度 5/5 一周以上 新手友好度 35/100
spyoungtech/FreeSimpleGUI#99 · 1 个 reaction ·
-
难度 5/5 一周以上 新手友好度 20/100
spyoungtech/FreeSimpleGUI#95 ·
查看 spyoungtech/FreeSimpleGUI 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 86/100
browser-use/browser-use#5905 ·
-
type: enhancement
难度 2/5 1-3 小时 新手友好度 68/100
ynput/ayon-python-api#363 ·
-
bug needs triage
难度 2/5 1-3 小时 新手友好度 88/100
modelscope/FunASR#3728 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
open-compass/opencompass#2655 ·