Open robinhoheisel opened 10 months ago
Hey,
This is suppsoed to be a minimal example to illustrate what I found. The actual project involves a listview with children composed from a larger number of sub widgets. Which has nothing to do with the issue at hand.
On my machine the click event for the customtkinter variant never triggers, while it does on the regular tkinter variant. That seems inconsistent, which is why I opened this issue.
i found dat =>
accctualy using in my app, and the job is rly rly goood <3
Ctkmenubar.py, in CustomDropdownMenu.py Customtkinter Menu Bar Author: Akash Bora Custom Dropdown Menu for CTkMenuBar Original Author: LucianoSaldivia | https://github.com/LucianoSaldivia Modified by: Akascape
if widget.master.winfo_name().startswith("!ctktitlemenu"):
widget.master.master.bind("<Button-1>", self._checkIfMouseLeft, add="+")
master = widget.master if master is None else master
widget.master.menu.append(self)
elif widget.master.winfo_name().startswith("!ctkmenubar"):
widget.winfo_toplevel().bind("<Double-Button-1>", self._checkIfMouseLeft, add="+")
master = widget.master.master if master is None else master
widget.master.menu.append(self)
else:
widget.winfo_toplevel().bind("<Double-Button-1>", self._checkIfMouseLeft, add="+")
master = widget.master if master is None else master
ahah ok, there is a thing about trigger event
this both action don't make the same result, like your button
While working at a project I discovered that using bind_class with the
I have prepared two examples:
In the above example, the events bound to
<Enter>
and<Leave>
work as expected while the<Button-1>
event never fires.I rebuilt the same example using tkinter inplace of customtkinter, In which the
<Button-1>
Event functions as expected:Is this the intended behaviour? I am working with python 3.11.4 on Windows 10.
I found the following workaround to get the behaviour I needed, but this feels rather hacky: