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

Class Toplevel

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

Toplevel widget, e.g. for dialogs.

Source from the content-addressed store, hash-verified

2883
2884
2885class Toplevel(BaseWidget, Wm):
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 15

__init__Method · 0.90
__init__Method · 0.90
_multistatus_barFunction · 0.90
_calltip_windowFunction · 0.90
_dyn_option_menuFunction · 0.90
_debug_object_browserFunction · 0.90
_color_delegatorFunction · 0.90
_grep_dialogFunction · 0.90
create_widgetsMethod · 0.90
_widget_redirectorFunction · 0.90
_io_bindingFunction · 0.90
_replace_dialogFunction · 0.90

Calls

no outgoing calls

Tested by 3

_make_top_and_buttonFunction · 0.72
test_open_and_closeMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…