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

Method __init__

Lib/tkinter/simpledialog.py:33–63  ·  view source on GitHub ↗
(self, master,
                 text='', buttons=[], default=None, cancel=None,
                 title=None, class_=None)

Source from the content-addressed store, hash-verified

31class SimpleDialog:
32
33 def __init__(self, master,
34 text='', buttons=[], default=None, cancel=None,
35 title=None, class_=None):
36 if class_:
37 self.root = Toplevel(master, class_=class_)
38 else:
39 self.root = Toplevel(master)
40 if title:
41 self.root.title(title)
42 self.root.iconname(title)
43
44 _setup_dialog(self.root)
45
46 self.message = Message(self.root, text=text, aspect=400)
47 self.message.pack(expand=1, fill=BOTH)
48 self.frame = Frame(self.root)
49 self.frame.pack()
50 self.num = default
51 self.cancel = cancel
52 self.default = default
53 self.root.bind('<Return>', self.return_event)
54 for num in range(len(buttons)):
55 s = buttons[num]
56 b = Button(self.frame, text=s,
57 command=(lambda self=self, num=num: self.done(num)))
58 if num == default:
59 b.config(relief=RIDGE, borderwidth=8)
60 b.pack(side=LEFT, fill=BOTH, expand=1)
61 self.root.protocol('WM_DELETE_WINDOW', self.wm_delete_window)
62 self.root.transient(master)
63 _place_window(self.root, master)
64
65 def go(self):
66 self.root.wait_visibility()

Callers

nothing calls this directly

Calls 13

doneMethod · 0.95
ToplevelClass · 0.85
_setup_dialogFunction · 0.85
lenFunction · 0.85
_place_windowFunction · 0.85
configMethod · 0.80
MessageClass · 0.70
FrameClass · 0.70
ButtonClass · 0.70
titleMethod · 0.45
packMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected