Tk Source Code

View Ticket
Login
Ticket UUID: 001f8d4f97053e00cedbf954b7c4a85f5d4b2408
Title: ttk::combobox: popdown list goes off screen when it fits neither below nor above
Type: Bug Version: 8.6.18, 9.0.5, 9.1b1
Submitter: serhiy.storchaka Created on: 2026-09-29 20:46:54
Subsystem: 88. Themed Tk Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-10-01 14:40:52
Resolution: Fixed Closed By: nemethi
    Closed on: 2026-10-01 14:40:52
Description:

ttk::combobox::PlacePopdown posts the list above the combobox if it does not fit below, but does not check that it fits above. A list taller than the space above and below starts above the top of the screen, so its first entries cannot be seen or clicked.

ttk::combobox .cb -values [lmap i [lrepeat 200 x] {incr n}] -height 150
pack .cb
wm geometry . +100+[expr {[winfo screenheight .] - 40}]

With a 1024 pixel high screen, the list is at y = -2170..984.

It could be limited to the larger of the spaces above and below, with a scrollbar, as menus and other toolkits do. It also uses winfo screenheight instead of the virtual root.

User Comments: nemethi (claiming to be Csaba Nemethi) added on 2026-10-01 14:40:52:

Serhiy, many thanks for the ticket and the fix! Merged into main, core-9-0-branch, and core-8-6-branch by commits [175e16c8], [a4c9f478], and [17dfb6aa].


serhiy.storchaka added on 2026-09-30 08:58:28:

Proposed fix in branch combobox-popdown-fit. The list is posted above the combobox only if it fits there. If it fits neither below nor above, it is posted on the side with more room, with fewer visible rows and the scrollbar shown, as in GTK and WinForms. The combobox demo got a fourth combobox with a long list.