I do not find a correct answer to my issue, despite intense research and a rather simple problem.
All I would like to do, is my comboboxes drop down when clicked on by 'Button-1'. But regardless of what I code, the combos don't behave as I wish.
following I prepared a simple code to demonstrate my problem:
from tkinter import *
if int(evt.type) is 4:
w = evt.widget
root = Tk()
li = ('row 1', 'row 2', 'row 3')
combo1 = tkinter.ttk.Combobox(root, value=li)
combo2 = tkinter.ttk.Combobox(root, value=li)
Why are you using
int(evt.type) is 4 instead of
int(evt.type) == 4 ?
Applying this change it works for me.
First of all, thank you for explaining to us what you really want to have. Did not expect this from your initial question.
If you want to override the editing behaviour it is time to dig a little deeper.
The widget you click into inside the combobox is an entry widget. What you can do now is to define when your event shall be fetched inside the event chain. Will apply code soon.
To get it at the first mouse click:
Why? Because default of Event Generate is to append the generated Event to the Event Chain (put it at its end, value = 'tail'). Changing to
when='head' gives your desired behaviour.