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

Method __init__

Lib/idlelib/help_about.py:26–58  ·  view source on GitHub ↗

Create popup, do not return until tk widget destroyed. parent - parent of this dialog title - string which is title of popup dialog _htest - bool, change box location when running htest _utest - bool, don't wait_window when running unittest

(self, parent, title=None, *, _htest=False, _utest=False)

Source from the content-addressed store, hash-verified

24
25 """
26 def __init__(self, parent, title=None, *, _htest=False, _utest=False):
27 """Create popup, do not return until tk widget destroyed.
28
29 parent - parent of this dialog
30 title - string which is title of popup dialog
31 _htest - bool, change box location when running htest
32 _utest - bool, don't wait_window when running unittest
33 """
34 Toplevel.__init__(self, parent)
35 self.configure(borderwidth=5)
36 # place dialog below parent if running htest
37 self.geometry("+%d+%d" % (
38 parent.winfo_rootx()+30,
39 parent.winfo_rooty()+(30 if not _htest else 100)))
40 self.bg = "#bbbbbb"
41 self.fg = "#000000"
42 self.create_widgets()
43 self.resizable(height=False, width=False)
44 self.title(title or
45 f'About IDLE {pyver} ({bits} bit)')
46 self.transient(parent)
47 self.grab_set()
48 self.protocol("WM_DELETE_WINDOW", self.ok)
49 self.parent = parent
50 self.button_ok.focus_set()
51 self.bind('<Return>', self.ok) # dismiss dialog
52 self.bind('<Escape>', self.ok) # dismiss dialog
53 self._current_textview = None
54 self._utest = _utest
55
56 if not _utest:
57 self.deiconify()
58 self.wait_window()
59
60 def create_widgets(self):
61 frame = Frame(self, borderwidth=2, relief=SUNKEN)

Callers

nothing calls this directly

Calls 10

create_widgetsMethod · 0.95
winfo_rootxMethod · 0.80
winfo_rootyMethod · 0.80
grab_setMethod · 0.80
protocolMethod · 0.80
wait_windowMethod · 0.80
configureMethod · 0.45
titleMethod · 0.45
focus_setMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected