MCPcopy Index your code
hub / github.com/python/cpython / wm_attributes

Method wm_attributes

Lib/tkinter/__init__.py:2209–2241  ·  view source on GitHub ↗

Return or sets platform specific attributes. When called with a single argument return_python_dict=True, return a dict of the platform specific attributes and their values. When called without arguments or with a single argument return_python_dict=False, return a tup

(self, *args, return_python_dict=False, **kwargs)

Source from the content-addressed store, hash-verified

2207 aspect = wm_aspect
2208
2209 def wm_attributes(self, *args, return_python_dict=False, **kwargs):
2210 """Return or sets platform specific attributes.
2211
2212 When called with a single argument return_python_dict=True,
2213 return a dict of the platform specific attributes and their values.
2214 When called without arguments or with a single argument
2215 return_python_dict=False, return a tuple containing intermixed
2216 attribute names with the minus prefix and their values.
2217
2218 When called with a single string value, return the value for the
2219 specific option. When called with keyword arguments, set the
2220 corresponding attributes.
2221 """
2222 if not kwargs:
2223 if not args:
2224 res = self.tk.call('wm', 'attributes', self._w)
2225 if return_python_dict:
2226 return _splitdict(self.tk, res)
2227 else:
2228 return self.tk.splitlist(res)
2229 if len(args) == 1 and args[0] is not None:
2230 option = args[0]
2231 if option[0] == '-':
2232 # TODO: deprecate
2233 option = option[1:]
2234 return self.tk.call('wm', 'attributes', self._w, '-' + option)
2235 # TODO: deprecate
2236 return self.tk.call('wm', 'attributes', self._w, *args)
2237 elif args:
2238 raise TypeError('wm_attribute() options have been specified as '
2239 'positional and keyword arguments')
2240 else:
2241 self.tk.call('wm', 'attributes', self._w, *self._options(kwargs))
2242
2243 attributes = wm_attributes
2244

Callers 4

_setup_dialogFunction · 0.80
test_wm_attributeMethod · 0.80
setUpClassMethod · 0.80
saved_change_hookMethod · 0.80

Calls 4

_splitdictFunction · 0.85
splitlistMethod · 0.80
callMethod · 0.45
_optionsMethod · 0.45

Tested by 1

test_wm_attributeMethod · 0.64