Commit cee7232
focus_get(), focus_displayof(), focus_lastfor() and winfo_containing()
now return None instead of raising KeyError when the focused widget was
not created by tkinter (for example a torn-off menu).
(cherry picked from commit 5fed5ce)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7a835cb commit cee7232
3 files changed
Lines changed: 36 additions & 4 deletions
File tree
- Lib
- test/test_tkinter
- tkinter
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
419 | 435 | | |
420 | 436 | | |
421 | 437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
806 | | - | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
807 | 810 | | |
808 | 811 | | |
809 | 812 | | |
| |||
812 | 815 | | |
813 | 816 | | |
814 | 817 | | |
815 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
816 | 822 | | |
817 | 823 | | |
818 | 824 | | |
819 | 825 | | |
820 | 826 | | |
821 | 827 | | |
822 | | - | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
823 | 832 | | |
824 | 833 | | |
825 | 834 | | |
| |||
1222 | 1231 | | |
1223 | 1232 | | |
1224 | 1233 | | |
1225 | | - | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
1226 | 1238 | | |
1227 | 1239 | | |
1228 | 1240 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments