Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Bug Found from PySimpleGUI spin element

オープン
#41 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
desktop

調査の方向性

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分
マージ済み PR(30日)
2

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spyoungtech/FreeSimpleGUI のほかの issue

spyoungtech/FreeSimpleGUI の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。