MCPcopy Create free account
hub / github.com/python/cpython / create_action_buttons

Method create_action_buttons

Lib/idlelib/configdialog.py:134–172  ·  view source on GitHub ↗

Return frame of action buttons for dialog. Methods: ok apply cancel help Widget Structure: outer: Frame buttons: Frame (no assignment): Button (ok) (no assignment): B

(self)

Source from the content-addressed store, hash-verified

132 self.create_action_buttons().pack(side=BOTTOM)
133
134 def create_action_buttons(self):
135 """Return frame of action buttons for dialog.
136
137 Methods:
138 ok
139 apply
140 cancel
141 help
142
143 Widget Structure:
144 outer: Frame
145 buttons: Frame
146 (no assignment): Button (ok)
147 (no assignment): Button (apply)
148 (no assignment): Button (cancel)
149 (no assignment): Button (help)
150 (no assignment): Frame
151 """
152 if macosx.isAquaTk():
153 # Changing the default padding on OSX results in unreadable
154 # text in the buttons.
155 padding_args = {}
156 else:
157 padding_args = {'padding': (6, 3)}
158 outer = Frame(self.frame, padding=2)
159 buttons_frame = Frame(outer, padding=2)
160 self.buttons = {}
161 for txt, cmd in (
162 ('Ok', self.ok),
163 ('Apply', self.apply),
164 ('Cancel', self.cancel),
165 ('Help', self.help)):
166 self.buttons[txt] = Button(buttons_frame, text=txt, command=cmd,
167 takefocus=FALSE, **padding_args)
168 self.buttons[txt].pack(side=LEFT, padx=5)
169 # Add space above buttons.
170 Frame(outer, height=2, borderwidth=0).pack(side=TOP)
171 buttons_frame.pack(side=BOTTOM)
172 return outer
173
174 def ok(self):
175 """Apply config changes, then dismiss dialog."""

Callers 1

create_widgetsMethod · 0.95

Calls 3

FrameClass · 0.90
ButtonClass · 0.90
packMethod · 0.45

Tested by

no test coverage detected