MCPcopy Create free account
hub / github.com/geekcomputers/Python / cal_buttons

Method cal_buttons

calculator-gui.py:203–378  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

201 )
202
203 def cal_buttons(self):
204 # ===== Row 1 =====
205 btn_c = tk.Button(
206 self.cal_frame,
207 text="Clear",
208 width=6,
209 height=2,
210 bd=2,
211 bg="#58a8e0",
212 command=self.press_clear,
213 )
214 btn_c.grid(row=1, column=0, sticky=tk.W, pady=5)
215 btn_div = tk.Button(
216 self.cal_frame,
217 text="/",
218 width=6,
219 height=2,
220 bd=2,
221 bg="#58a8e0",
222 command=self.press_div,
223 )
224 btn_div.grid(row=1, column=1, sticky=tk.W)
225 btn_mul = tk.Button(
226 self.cal_frame,
227 text="*",
228 width=6,
229 height=2,
230 bd=2,
231 bg="#58a8e0",
232 command=self.press_mul,
233 )
234 btn_mul.grid(row=1, column=2, sticky=tk.E)
235 btn_min = tk.Button(
236 self.cal_frame,
237 text="-",
238 width=6,
239 height=2,
240 bd=2,
241 bg="#58a8e0",
242 command=self.press_min,
243 )
244 btn_min.grid(row=1, column=3, sticky=tk.E)
245 # ===== Row 2 =====
246 btn_7 = tk.Button(
247 self.cal_frame,
248 text="7",
249 width=6,
250 height=2,
251 bd=2,
252 bg="#90a9b8",
253 command=self.press_7,
254 )
255 btn_7.grid(row=2, column=0, sticky=tk.W, pady=2)
256 btn_8 = tk.Button(
257 self.cal_frame,
258 text="8",
259 width=6,
260 height=2,

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected