|
|
|
|
@ -1,20 +1,12 @@ |
|
|
|
|
''' |
|
|
|
|
Created on Jun 03, 2022 |
|
|
|
|
|
|
|
|
|
@author: error042 |
|
|
|
|
''' |
|
|
|
|
import tkinter as tk |
|
|
|
|
from tkinter import ttk |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class View(tk.Tk): |
|
|
|
|
''' |
|
|
|
|
classdocs |
|
|
|
|
''' |
|
|
|
|
|
|
|
|
|
PAD = 10 |
|
|
|
|
MAX_BUTTONS_PER_ROW = 4 |
|
|
|
|
button_captions = [ |
|
|
|
|
BUTTON_CAPTIONS = [ |
|
|
|
|
'C', '+/-', '%', '/', |
|
|
|
|
7, 8, 9, '*', |
|
|
|
|
4, 5, 6, '-', |
|
|
|
|
@ -23,9 +15,6 @@ class View(tk.Tk): |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
def __init__(self, controller): |
|
|
|
|
''' |
|
|
|
|
Constructor |
|
|
|
|
''' |
|
|
|
|
super().__init__() |
|
|
|
|
|
|
|
|
|
self.title('PyCalc') |
|
|
|
|
@ -56,7 +45,7 @@ class View(tk.Tk): |
|
|
|
|
frm = ttk.Frame(outer_frm) |
|
|
|
|
frm.pack() |
|
|
|
|
|
|
|
|
|
for buttons_in_row, caption in enumerate(self.button_captions): |
|
|
|
|
for buttons_in_row, caption in enumerate(self.BUTTON_CAPTIONS): |
|
|
|
|
if buttons_in_row % self.MAX_BUTTONS_PER_ROW == 0: |
|
|
|
|
frm = ttk.Frame(outer_frm) |
|
|
|
|
frm.pack() |
|
|
|
|
|