Skip to content

Tests - #2886

Merged
TomSchimansky merged 11 commits into
developfrom
tests
Nov 14, 2026
Merged

Tests#2886
TomSchimansky merged 11 commits into
developfrom
tests

Conversation

@TomSchimansky

Copy link
Copy Markdown
Owner

No description provided.

- font tuples with several styles in one string, like ("Arial", 14, "bold italic"), raised "unknown font style"
- CTkFont.copy() raised a TypeError, a font tuple without size raised a KeyError
- configuring a CTkImage after a CTkButton or CTkLabel that used it was destroyed raised a TclError
- ThemeManager.save_theme() opened the theme file for reading
- destroyed CTkToplevel windows stayed in the ScalingTracker
- widgets and windows with an unknown argument are removed again instead of staying half created
- readonly CTkComboBox didn't show its first value
- CTkTabview: insert(), move(), configure without tabs and cget() of the segmented button colors
- CTkScrollableFrame: cget("label_text_color")
- color tuple with one element raised an IndexError instead of a ValueError
- unit tests for the options, methods and events of every widget, windows and CTkInputDialog, fonts, images, themes, appearance mode, scaling, Linux Xft.dpi detection, DrawEngine, CTkCanvas and utility functions
- integration tests with screenshots for every drawing method, mouse and keyboard interaction, appearance mode, scaling and window size changes at runtime, Linux HiDPI scaling in a separate X server, and all examples and manual test scripts
- fix manual test scripts with missing images and a missing de_DE locale
Tk 8.6 reads the width of canvas items and the canvas size with strtod(), which uses the decimal separator of the locale. Floats like 8.0 are passed as int now, other floats are rounded if the locale has no decimal point.

The option menu test doesn't check if the dropdown is open on macOS, where menus are native.
- the dropdown test only opens the menu on X11, post() waits on Windows until the menu is closed
- the tests use the window that checks for a display instead of creating a second Tk interpreter
Since Tk 8.7 one wheel step has a delta of 120 on macOS like on the other platforms (TIP 474), CTkScrollableFrame and CTkScrollbar scrolled 120 times too far.
After a scaling change, min and max size of CTk and CTkToplevel are set to the current size for one second. geometry() now sets the scaled min and max size first, so the new size isn't blocked.

The window tests use the test window instead of a second CTk, several Tk interpreters at the same time can block update() with Tk 8.6 on macOS.
The unscaled size of a widget was stored as int, so int(58 / 1.25) = 46 was drawn as int(46 * 1.25) = 57 pixels on a canvas of 58 pixels. The last pixel row and column showed the canvas background, visible as lines at the edges of CTkSegmentedButton and CTkTabview. The size is stored exactly now, and the background corners reach to the edge of the canvas.
… first time

The window could open behind the terminal or IDE that started the program. It's lifted above all windows for a moment, and focus_force() activates the app. Not done if withdraw() or iconify() was called before.
@TomSchimansky
TomSchimansky merged commit 7516ef0 into develop Nov 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant