Tk Source Code

View Ticket
Login
Ticket UUID: 26b28253194426541052eb9051149abf62c69a6d
Title: Strange behavior for highlightthickness/insertwidth/insertborderwidth in entry/spinbox
Type: Bug Version: 8.6
Submitter: jan.nijtmans Created on: 2024-08-08 15:36:06
Subsystem: 17. [spinbox] Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2024-08-09 11:54:53
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2024-08-09 11:54:53
Description:

Example:

$ wish8.6
% spinbox .s
.s
% .s configure -highlightthickness -1 -insertwidth -1 -insertborderwidth -1
% .s cget -highlightthickness
0
% .s cget -insertwidth
2
% .s cget -insertborderwidth
-1
% .s configure -insertborderwidth 200
% .s cget -insertborderwidth
1

Note: -insertwidth is not documented as being non-negative, but it should: Trying to set it to a negative value, it is reset to the value 2. No other option does that.

Note 2): -insertborderwidth is documented as being non-negative, but setting it to a negative value is just possible. It's unclear what is expected to happen then.

Note 3): Setting -insertborderwidth to a value bigger than half the insertwidth is not possible: it will be set to half the insertwidth. No other option does that.

User Comments: jan.nijtmans added on 2024-08-09 11:54:53:

Fixed [e2089c7fc5428980|here]


jan.nijtmans added on 2024-08-08 22:53:36:

> Note that changing 3) could have weird effects when drawing the cursor no ?

Yeah, indeed, but that can be [27c995693b3f890a|solved] too.

This solution even solves the following current strange behavior:

$ wish8.6
% spinbox .s
.s
% .s configure -insertborderwidth 10
% .s configure -insertwidth 20
% .s cget -insertborderwidth
0
% .s configure -insertborderwidth 10
% .s cget -insertborderwidth
10

Thanks!


fvogel added on 2024-08-08 16:08:14:
Note that changing 3) could have weird effects when drawing the cursor no ?