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

Method __init__

Lib/tkinter/__init__.py:2888–2912  ·  view source on GitHub ↗

Construct a toplevel widget with the parent MASTER. Valid option names: background, bd, bg, borderwidth, class, colormap, container, cursor, height, highlightbackground, highlightcolor, highlightthickness, menu, relief, screen, takefocus, use, visual, width.

(self, master=None, cnf={}, **kw)

Source from the content-addressed store, hash-verified

2886 """Toplevel widget, e.g. for dialogs."""
2887
2888 def __init__(self, master=None, cnf={}, **kw):
2889 """Construct a toplevel widget with the parent MASTER.
2890
2891 Valid option names: background, bd, bg, borderwidth, class,
2892 colormap, container, cursor, height, highlightbackground,
2893 highlightcolor, highlightthickness, menu, relief, screen, takefocus,
2894 use, visual, width."""
2895 if kw:
2896 cnf = _cnfmerge((cnf, kw))
2897 extra = ()
2898 for wmkey in ['screen', 'class_', 'class', 'visual',
2899 'colormap']:
2900 if wmkey in cnf:
2901 val = cnf[wmkey]
2902 # TBD: a hack needed because some keys
2903 # are not valid as keyword arguments
2904 if wmkey[-1] == '_': opt = '-'+wmkey[:-1]
2905 else: opt = '-'+wmkey
2906 extra = extra + (opt, val)
2907 del cnf[wmkey]
2908 BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
2909 root = self._root()
2910 self.iconname(root.iconname())
2911 self.title(root.title())
2912 self.protocol("WM_DELETE_WINDOW", self.destroy)
2913
2914
2915class Button(Widget):

Callers

nothing calls this directly

Calls 5

_cnfmergeFunction · 0.85
_rootMethod · 0.80
protocolMethod · 0.80
__init__Method · 0.45
titleMethod · 0.45

Tested by

no test coverage detected