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

Method __init__

Lib/tkinter/simpledialog.py:96–145  ·  view source on GitHub ↗

Initialize a dialog. Arguments: parent -- a parent window (the application window) title -- the dialog title

(self, parent, title = None)

Source from the content-addressed store, hash-verified

94 '''
95
96 def __init__(self, parent, title = None):
97 '''Initialize a dialog.
98
99 Arguments:
100
101 parent -- a parent window (the application window)
102
103 title -- the dialog title
104 '''
105 master = parent
106 if master is None:
107 master = _get_temp_root()
108
109 Toplevel.__init__(self, master)
110
111 self.withdraw() # remain invisible for now
112 # If the parent is not viewable, don't
113 # make the child transient, or else it
114 # would be opened withdrawn
115 if parent is not None and parent.winfo_viewable():
116 self.transient(parent)
117
118 if title:
119 self.title(title)
120
121 _setup_dialog(self)
122
123 self.parent = parent
124
125 self.result = None
126
127 body = Frame(self)
128 self.initial_focus = self.body(body)
129 body.pack(padx=5, pady=5)
130
131 self.buttonbox()
132
133 if self.initial_focus is None:
134 self.initial_focus = self
135
136 self.protocol("WM_DELETE_WINDOW", self.cancel)
137
138 _place_window(self, parent)
139
140 self.initial_focus.focus_set()
141
142 # wait for window to appear on screen before calling grab_set
143 self.wait_visibility()
144 self.grab_set()
145 self.wait_window(self)
146
147 def destroy(self):
148 '''Destroy the window'''

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 14

bodyMethod · 0.95
buttonboxMethod · 0.95
_get_temp_rootFunction · 0.90
_setup_dialogFunction · 0.85
_place_windowFunction · 0.85
winfo_viewableMethod · 0.80
focus_setMethod · 0.80
wait_visibilityMethod · 0.80
grab_setMethod · 0.80
wait_windowMethod · 0.80
FrameClass · 0.70
titleMethod · 0.45

Tested by

no test coverage detected