MCPcopy Index your code
hub / github.com/RustPython/RustPython / wm_attributes

Method wm_attributes

Lib/tkinter/__init__.py:2133–2165  ·  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

2131 aspect = wm_aspect
2132
2133 def wm_attributes(self, *args, return_python_dict=False, **kwargs):
2134 """Return or sets platform specific attributes.
2135
2136 When called with a single argument return_python_dict=True,
2137 return a dict of the platform specific attributes and their values.
2138 When called without arguments or with a single argument
2139 return_python_dict=False, return a tuple containing intermixed
2140 attribute names with the minus prefix and their values.
2141
2142 When called with a single string value, return the value for the
2143 specific option. When called with keyword arguments, set the
2144 corresponding attributes.
2145 """
2146 if not kwargs:
2147 if not args:
2148 res = self.tk.call('wm', 'attributes', self._w)
2149 if return_python_dict:
2150 return _splitdict(self.tk, res)
2151 else:
2152 return self.tk.splitlist(res)
2153 if len(args) == 1 and args[0] is not None:
2154 option = args[0]
2155 if option[0] == '-':
2156 # TODO: deprecate
2157 option = option[1:]
2158 return self.tk.call('wm', 'attributes', self._w, '-' + option)
2159 # TODO: deprecate
2160 return self.tk.call('wm', 'attributes', self._w, *args)
2161 elif args:
2162 raise TypeError('wm_attribute() options have been specified as '
2163 'positional and keyword arguments')
2164 else:
2165 self.tk.call('wm', 'attributes', self._w, *self._options(kwargs))
2166
2167 attributes = wm_attributes
2168

Callers 1

_setup_dialogFunction · 0.80

Calls 4

_splitdictFunction · 0.85
lenFunction · 0.85
callMethod · 0.45
_optionsMethod · 0.45

Tested by

no test coverage detected