Tk Source Code

View Ticket
Login
Ticket UUID: 0fb337ea8455bd8e1e75c5af2f5a29459cf55a28
Title: ttk::combobox selection overruns downarrow element
Type: Bug Version: 8.7/9.0
Submitter: emiliano Created on: 2024-05-27 14:18:38
Subsystem: 88. Themed Tk Assigned To: fvogel
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2024-06-02 07:17:14
Resolution: Fixed Closed By: fvogel
    Closed on: 2024-06-02 07:17:14
Description:
On X11 at least the combobox selection overruns the down arrow if the selected text is longer than the text area.

Demo script

  package require Tk
  pack [ttk::combobox .cb -width 10]
  .cb insert 0 "THIS_IS_A_LONG_TEXT"
  .cb selection range 0 end
User Comments: fvogel added on 2024-06-02 07:17:06:
OK, got it. The problem can be reproduced after having added "pack configure .cb -expand 1 -fill x" and resizing the width of the root window using the mouse.

Fix now merged, thanks!

fvogel added on 2024-06-01 09:39:41:
While I understand and value the proposed patch, I fail in reproducing the problem on Linux Debian 11, whatever theme is used (available ones are: clam alt default classic). Is there something more than the provided script to do?

fvogel added on 2024-05-29 19:57:13:

Patch committed in [0a36b34b08]. Thanks!


emiliano added on 2024-05-28 21:56:03:
Forgot to mention: patch is against trunk, but the defect is present in all active branches

emiliano added on 2024-05-28 21:52:38:
in generic/ttk/ttkEntry.c, function EntryDisplay(), the code doesn't check whether the selection rectangle lies inside the "textarea" box.

Attached patch solves the issue.

Note that the selection borderwidth still can project outside the assigned parcel. This is evident with -selectborderwidth > 3.

emiliano added on 2024-05-27 14:21:21:
Attached screenshots with and without selection

Attachments: