gh-43457: Tkinter: fix design flaws in wm_attributes() (GH-111404)

* When called with a single argument to get a value, it allow to omit
  the minus prefix.
* It can be called with keyword arguments to set attributes.
* w.wm_attributes(return_python_dict=True) returns a dict instead of 
  a tuple (it will be the default in future).
* Setting wantobjects to 0 no longer affects the result.
This commit is contained in:
Serhiy Storchaka 2024-02-05 18:24:54 +02:00 committed by GitHub
parent 992446dd5b
commit b4ba0f73d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 104 additions and 19 deletions

View file

@ -262,7 +262,7 @@ def _setup_dialog(w):
w.tk.call("::tk::unsupported::MacWindowStyle", "style",
w, "moveableModal", "")
elif w._windowingsystem == "x11":
w.wm_attributes("-type", "dialog")
w.wm_attributes(type="dialog")
# --------------------------------------------------------------------
# convenience dialogues