MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / Toplevel

Class Toplevel

tools/python-3.11.9-amd64/Lib/tkinter/__init__.py:2673–2700  ·  view source on GitHub ↗

Toplevel widget, e.g. for dialogs.

Source from the content-addressed store, hash-verified

2671
2672
2673class Toplevel(BaseWidget, Wm):
2674 """Toplevel widget, e.g. for dialogs."""
2675
2676 def __init__(self, master=None, cnf={}, **kw):
2677 """Construct a toplevel widget with the parent MASTER.
2678
2679 Valid resource names: background, bd, bg, borderwidth, class,
2680 colormap, container, cursor, height, highlightbackground,
2681 highlightcolor, highlightthickness, menu, relief, screen, takefocus,
2682 use, visual, width."""
2683 if kw:
2684 cnf = _cnfmerge((cnf, kw))
2685 extra = ()
2686 for wmkey in ['screen', 'class_', 'class', 'visual',
2687 'colormap']:
2688 if wmkey in cnf:
2689 val = cnf[wmkey]
2690 # TBD: a hack needed because some keys
2691 # are not valid as keyword arguments
2692 if wmkey[-1] == '_': opt = '-'+wmkey[:-1]
2693 else: opt = '-'+wmkey
2694 extra = extra + (opt, val)
2695 del cnf[wmkey]
2696 BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
2697 root = self._root()
2698 self.iconname(root.iconname())
2699 self.title(root.title())
2700 self.protocol("WM_DELETE_WINDOW", self.destroy)
2701
2702
2703class Button(Widget):

Callers 15

__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
_search_dialogFunction · 0.90

Calls

no outgoing calls

Tested by 3

_make_top_and_buttonFunction · 0.72
test_open_and_closeMethod · 0.72