TIP 681: Ttk "size"-related options

Login
Author:		Jan Nijtmans <[email protected]>
State:		Final
Type:		Project
Vote:		Done
Created:	07-11-2023
Tcl-Version:	9.0
Tk-Branch:	gripsize
Vote-Summary:	Accepted 4/0/0
Votes-For:	FV, JN, KW, SL
Votes-Against:	none
Votes-Present:	none

Abstract

The Ttk options related to sizes are not always named size. This TIP is meant to make those options consistent.

Rationale

When Tk was made scalable (Thanks to Csaba!), a lot of ttk options changed from being integers (pixels) to floats (screen units). This work made it visible that some options were not named consistently. A major Tk release is a perfect excuse to correct this.

There is hardly any code around using those options. The only ones I found were scrollutil and tablelist from tklib (both from Csaba, and already adapted for this change) and azure-ttk, sum-valley-ttk and ttk-themes (still need to be adapted)

If you want to make your ttk widgets/styles work for both Tk 8.x and 9.0, the solution is to provide both options: ttk simply ignores any unknown options.

So in "ttk-themes", "-gripcount 16" should be changed to "-gripcount 16 -gripsize 24p". As a bonus, the grip will become scalable in Tk 9.0, while the code still works with Tk 8.6 too.

Implementation

The following options are renamed:

With respect to -gripcount/-gripsize, there's a factor 2 involved, so "-gripcount 5" is equivalent to "-gripsize 10" (or "-gripsize 7.5p", if you want to make it scalable). The other options are renamed, nothing more.

Implementation is in Tk branch "gripsize".

Since this is the first TIP brought into voting state for Tk 9.0, the renumbering from 8.7 -> 9.0 is also done in the implementation branch.

Copyright

This document has been placed in the public domain.