Skip to content

Commit 26128f1

Browse files
committed
Update button.py
Adds buttons to a list
1 parent 837e7d1 commit 26128f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

calculator/gui/button.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ class CalculatorButtons:
1515
def __init__(self, calculator: calc.Calculator):
1616
self.calculator = calculator
1717
self.frame = None
18+
self.buttons = []
1819

1920
def create_gui(self, root, layout=LAYOUT_STANDARD, width=4):
2021
self.frame = tk.Frame(root)
2122

2223
for i, label in enumerate(layout):
2324
button = calc_button(self.frame, self.calculator, label)
2425
button.grid(column=i%width, row=int(i/width), sticky=tk.NSEW)
26+
self.buttons.append(button)
2527

2628
for i in range(width):
2729
self.frame.grid_columnconfigure(i, uniform="calc_buttons", weight=1)
2830

2931
for i in range(int(len(layout)/width)):
3032
self.frame.grid_rowconfigure(i, weight=1)
31-
33+
3234
def update(self):
3335
pass

0 commit comments

Comments
 (0)