[issue44592] tkinter focus_get() with non-tkinter Tk widget
Terry J. Reedy
report at bugs.python.org
Fri Jul 9 16:46:54 EDT 2021
Terry J. Reedy <tjreedy at udel.edu> added the comment:
Akuli, what tk widgets do you think are not known to tkinter? In any case, tk menu is known to tkinter.
I cannot reproduce when running on Windows with 3.10.0b3: Add "print(root.children)" (after add_cascade) results in {'!menu': <tkinter.Menu object .!menu>, '!menu2': <tkinter.Menu object .!menu2>}. The names are created in tkinter.py lines 2564-2573.
I then see 'None' once and then '<tkinter.Tk object .>' indefinitely even while hovering over and clicking 'click me' and the dropdown. If I click outside the tk box, the print returns to 'None'.
Maybe there is an OS difference in what is considered to have 'focus'.
Key '#!menu' looks like '!menu' with '#' prepended. Someone could try changing the tkinter code referenced above and see if the change appears in the bad key. Also check the contents of root.children.
----------
nosy: +terry.reedy
resolution: duplicate ->
stage: resolved ->
status: closed -> open
superseder: Make Tkinter.py's nametowidget work with cloned menu widgets ->
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44592>
_______________________________________
More information about the Python-bugs-list
mailing list