Tk Library Source Code

View Ticket
Login
Ticket UUID: 69caeb41e9bfb36afa5ca3bdbfea4e5db80033d
Title: widget: bugs found by the new tests
Type: Bug Version: trunk
Submitter: serhiy.storchaka Created on: 2026-11-21 18:08:49
Subsystem: tklib :: widget Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2026-11-21 18:08:49
Resolution: None Closed By: nobody
    Closed on:
Description:

The bugs below were found by the tests in branch tests-widget; each is covered by a test with the knownBug constraint (widget-1.1, 4.1, 5.3, 5.4, 5.12, widget_calendar-1.9, 1.15, 1.16, 4.1.1, 4.5, 4.7, 4.8.1, widget_dateentry-3.3, 5.1, widget_toolbar-2.4). All of them occur with Tk 8.6 and 9.1.

  • The widget man page documents widget::validate, but the command is named widget::isa; widget::validate fails with invalid command name "widget::validate" (widget-1.1).
  • The example in the widget man page, widget::superframe .f -type separator -text "SuperFrame:", fails with unknown option "-type": the option is named -style (widget-4.1).
  • The constructor of widget::superframe contains a debugging parray options, so every creation prints the options array to stdout (widget-5.12).
  • widget::scrolledwindow with -auto none never shows its scrollbars: setwidget first runs the pending idle setup, which removes the scrollbars because no widget is set yet, and nothing grids them later (only the automatic mode does). Both bars stay unmapped after .sw setwidget .sw.t (widget-5.3, and -scrollbar vertical in widget-5.4).
  • widget::calendar -language gr and -language he: the month and weekday names for these documented languages are garbled in the source (mojibake with U+FFFD and "?" characters), and the weekday list splits into the wrong number of words, so the title row gets 10 and 9 items instead of 8 (widget_calendar-1.9).
  • Destroying a widget::calendar before the idle refresh runs gives a background error namespace "::widget::calendar::Snit_inst..." not found: the destructor does not cancel the pending after idle refresh (widget_calendar-1.15).
  • widget::calendar .c -textvariable d -dateformat %Y-%m-%d with d set to 2024-03-05 fails with input string does not match supplied format: the options are processed in the given order, and the variable is parsed with the default format before -dateformat is set (widget_calendar-1.16).
  • Calendar keyboard navigation: when moving back by days lands exactly on the last day of the previous month (Left from the 1st, Up from the 7th), the day becomes 0 ((day + dday) % maxday). With Tk 8.6 03/01/2024 Left gives 01/31/2024 instead of 02/29/2024; with Tk 9.1 the date does not change and a background error unable to convert input string: invalid day is raised (widget_calendar-4.1.1, 4.5).
  • Calendar month and year navigation does not clamp the day to the end of the month: Control-Right from 01/31/2024 gives 03/02/2024 instead of 02/29/2024, Control-Up from 02/29/2024 gives 03/01/2023 instead of 02/28/2023. The day overflow is handled by the branch for day steps before the clamp at the end of adjust is reached (widget_calendar-4.7, 4.8.1).
  • widget::dateentry: the man page says that the -textvariable is linked in both directions, but the set method does not update the variable: after .de set 01/01/2000 the variable keeps its old value (widget_dateentry-3.3).
  • widget::dateentry -command: the man page says that the command gets the raw date in seconds and then the formatted date, but the code passes the formatted date first and the raw date second (widget_dateentry-5.1).
  • widget::toolbar: .tb add button mybutton returns _button1 instead of mybutton: the given symbol is replaced with an automatic one when no options follow it (widget_toolbar-2.4).

Already reported: [fa6fbae045] (widget_dateentry-3.2, 3.5, 3.6; branch dateentry-textvariable).