Here is example of simple ttk dialog to demonstrate my problem:
from Tkinter import *
import ttk
items = ["Item %d" % (i+1,) for i in range(9)]
d = dict(zip(items, [i + ' description.' for i in items]))
root = Tk()
frame = ttk.Frame(root, padding=8)
cb_val = StringVar()
cb_val.set('Item 1')
cb = ttk.Combobox(frame, textvariable=cb_val, height=4)
cb['values'] = sorted(d.keys())
statusmsg = StringVar()
status = ttk.Label(frame, textvariable=statusmsg, relief='solid')
frame.grid()
cb.grid()
status.grid(pady=(80, 0), sticky='SWE')
cb.bind('<<ComboboxSelected>>',
lambda e: statusmsg.set(d[sorted(d.keys())[int(cb.current())]]))
root.mainloop()
So I bind <ComboboxSelected>
event to extract selected combobox item by using current()
method, then use dictionary lookup to print item description in made statusbar.
This is not bad, but I would like to bind on "hover item" event if possible, and extract the value of currently hovered item from combobox dropdown menu (or as in example screenshot I would like to get "Item 3 description." in statusbar)
As I can't find any documentation about such event, or another approach I thought to ask this here.
Here is my brief example