Commit 5fed5ce
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).
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8f4abfc commit 5fed5ce
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 | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
410 | 426 | | |
411 | 427 | | |
412 | 428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
897 | | - | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
898 | 901 | | |
899 | 902 | | |
900 | 903 | | |
| |||
903 | 906 | | |
904 | 907 | | |
905 | 908 | | |
906 | | - | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
907 | 913 | | |
908 | 914 | | |
909 | 915 | | |
910 | 916 | | |
911 | 917 | | |
912 | 918 | | |
913 | | - | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
914 | 923 | | |
915 | 924 | | |
916 | 925 | | |
| |||
1313 | 1322 | | |
1314 | 1323 | | |
1315 | 1324 | | |
1316 | | - | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
1317 | 1329 | | |
1318 | 1330 | | |
1319 | 1331 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments