Commit 5730c90
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 ee1ae1d commit 5730c90
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 | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
407 | 423 | | |
408 | 424 | | |
409 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
821 | 824 | | |
822 | 825 | | |
823 | 826 | | |
| |||
826 | 829 | | |
827 | 830 | | |
828 | 831 | | |
829 | | - | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
830 | 836 | | |
831 | 837 | | |
832 | 838 | | |
833 | 839 | | |
834 | 840 | | |
835 | 841 | | |
836 | | - | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
837 | 846 | | |
838 | 847 | | |
839 | 848 | | |
| |||
1236 | 1245 | | |
1237 | 1246 | | |
1238 | 1247 | | |
1239 | | - | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1240 | 1252 | | |
1241 | 1253 | | |
1242 | 1254 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments