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

No callback when re-selecting in choice%

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
領域
desktop

調査の方向性

choice% の実装とリンクされている choice% のドキュメントから始め、提供されている #lang racket/gui の例を使って Linux でのコールバック動作を再現します。ドキュメントに記載されたコールバックの基準と観測された動作を比較し、関連するプラットフォームのケース全体で結果を検証します。動作またはドキュメントの整合性が取られ、テストされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

When using Racket 8.0 under Kubuntu 20.04 (Qt version 5.12.8, KDE Frameworks version 5.68.0), the callback function in choice% is not called when clicking on the already selected item, but only when clicking on a different item. I was not able to test on a different system, but as explained in this reddit post @sorawee tried the code on both Linux and Mac OS and was only able to reproduce the bug on the former.

This example reproduces the behavior:

#lang racket/gui

(define main-window (new frame% [label "Callback test"] [width 400] [height 400] [border 10]))

(new choice%
    [label "Choice"]
    [parent main-window]
    [choices (list "Option A" "Option B" "Option C")]
    [callback
        (lambda (c e) (new message% [parent callback-log]
                                    [label (string-append (symbol->string (send e get-event-type))
                                                          " event @"
                                                          (number->string (send e get-time-stamp)))]))])

(define callback-log
    (new group-box-panel% [parent main-window]
                          [label "List of callback events:"]
                          [min-height 200]))

(send main-window show #t)

It might be interesting to consider rewording the documentation for choice%, since two slightly different criteria are given for when the callback is invoked. It first says (emphasis mine):

Whenever the selection of a choice item is changed by the user, the choice item’s callback procedure is invoked.

which implies that the newly selected item needs to be different from the previously selected one, yet a bit later it says:

The callback procedure is called (with the event type 'choice) when the user selects a choice item (or re-selects the currently selected item).

主要言語
Racket
スター
68
フォーク
83
平均マージ
12日 5時間
マージ済み PR(30日)
3

環境構築

はじめの一歩

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

racket/gui のほかの issue

racket/gui の issue をすべて見る

似ている issue

Desktop Dev の issue をもっと見る

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

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