[New-bugs-announce] [issue46803] Item not shown when using mouse wheel to scroll for Listbox/Combobox

Jason Yang report at bugs.python.org
Sun Feb 20 01:30:30 EST 2022


New submission from Jason Yang <jason990420 at outlook.com>:

When scrolled items by mouse wheel in tk.Listbox/ttk.Combobox, some items not shown.

Is it a bug ? or I did something wrong ?

In following case, 'Wednesday' will not shown when scroll mouse wheel at

- tk.Listbox or vertical scrollbar of tk.Listbox, or
- listbox of ttk.Combo

```python
from tkinter import *
from tkinter import ttk

font = ('Courier New', 24)
lst = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')

root = Tk()

frame1 = Frame(root)
frame1.pack(side=LEFT)
vsb1 = Scrollbar(frame1, orient='v')
vsb1.pack(side=RIGHT, fill='y')
var = StringVar()
var.set(lst)
listbox = Listbox(frame1, width=10, height=3, listvariable=var, font=font, yscrollcommand=vsb1.set)
listbox.pack(side=LEFT)
vsb1.configure(command=listbox.yview)

frame2 = Frame(root)
frame2.pack(side=LEFT, fill='y')
combobox = ttk.Combobox(frame2, values=lst, width=10, height=3, font=font)
combobox.pack()

root.mainloop()
```

Platform: WIN10

----------
components: Tkinter
files: PeS9r.png
messages: 413564
nosy: Jason990420
priority: normal
severity: normal
status: open
title: Item not shown when using mouse wheel to scroll for Listbox/Combobox
type: behavior
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50634/PeS9r.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46803>
_______________________________________


More information about the New-bugs-announce mailing list