Tablesaw-GUI/main.py

594 lines
32 KiB
Python

from customtkinter import CTk, CTkFrame, CTkLabel, CTkEntry, CTkButton, CTkToplevel
global firstNumber
global mathType
class App(CTk):
WIDTH = 800
HEIGHT = 480
calcPaddingX = 2
calcPaddingY = 2
calcWidth = 71
calcHeight = 40
calcNumberFG = "#134266"
calcMathFG = "#0C2940"
calcClearFG = "#990000"
buttonFont = "Roboto Medium"
buttonFontSize = 16
numberBoxFont = "Roboto Medium"
numberBoxFontSize = 37
PRE_B_WIDTH = 90
PRE_B_HEIGHT = 40
def __init__(self):
super().__init__()
self.geometry(f"{App.WIDTH}x{App.HEIGHT}")
self.resizable(False, False)
self.grid_columnconfigure(2, weight=1)
self.grid_rowconfigure(0, weight=1)
self.title("Table Saw Controls")
def format_number(num):
if num % 1 == 0:
return int(num)
else:
return num
def button_click(number):
current = self.numberBox.get()
self.numberBox.delete("0", "end")
self.numberBox.insert(0, str(current) + str(number))
def convert(scale_type):
if not self.numberBox.get():
c_num = 0.00
else:
c_num = float(self.numberBox.get())
if scale_type == "mm":
ans_in_mm = float(c_num) * 25.4
self.numberBox.delete("0", "end")
self.numberBox.insert(0, ans_in_mm)
if scale_type == "in":
ans_in_inch = float(c_num) / 25.4
self.numberBox.delete("0", "end")
self.numberBox.insert(0, ans_in_inch)
def import_to(option, location):
if not self.numberBox.get():
c_num = 0.00
else:
c_num = float(self.numberBox.get())
c_num = round(c_num, 3)
self.numberBox.delete("0", "end")
if option == "fence":
if location == "current_location":
self.fenceLocation.delete("0", "end")
self.fenceLocation.insert(0, c_num)
clear("calc")
if location == "destination_location":
self.fenceDestination.delete("0", "end")
self.fenceDestination.insert(0, c_num)
clear("calc")
if option == "angle":
if location == "current_location":
self.angleCurrentNumber.delete("0", "end")
self.angleCurrentNumber.insert(0, c_num)
clear("calc")
if location == "destination_location":
self.angleDestinationNumber.delete("0", "end")
self.angleDestinationNumber.insert(0, c_num)
clear("calc")
if option == "height":
if location == "current_location":
self.heightCurrentNumber.delete("0", "end")
self.heightCurrentNumber.insert(0, c_num)
clear("calc")
if location == "destination_location":
self.heightDestinationNumber.delete("0", "end")
self.heightDestinationNumber.insert(0, c_num)
clear("calc")
def clear(location):
if location == "calc":
self.numberBox.delete("0", "end")
self.numberBox.configure(placeholder_text="0")
if location == "fence_cur":
self.fenceLocation.delete("0", "end")
if location == "fence_destination":
self.fenceDestination.delete("0", "end")
if location == "angle_cur":
self.angleCurrentNumber.delete("0", "end")
if location == "angle_destination":
self.angleDestinationNumber.delete("0", "end")
if location == "height_cur":
self.heightCurrentNumber.delete("0", "end")
if location == "height_destination":
self.heightDestinationNumber.delete("0", "end")
def calculate(math_type):
if math_type == "add" or "sub" or "mult" or "div":
if not self.numberBox.get():
first_number = 0.00
else:
first_number = self.numberBox.get()
global firstNumber
global mathType
# f_num = float(first_number)
firstNumber = first_number
if math_type == "add":
mathType = "addition"
ph_string = f'{first_number} + '
self.numberBox.configure(placeholder_text=ph_string)
if math_type == "sub":
mathType = "subtraction"
ph_string = f'{first_number} - '
self.numberBox.configure(placeholder_text=ph_string)
if math_type == "mult":
mathType = "multiplication"
ph_string = f'{first_number} x '
self.numberBox.configure(placeholder_text=ph_string)
if math_type == "div":
mathType = "division"
ph_string = f'{first_number} ÷ '
self.numberBox.configure(placeholder_text=ph_string)
firstNumber = float(first_number)
self.numberBox.delete("0", "end")
def button_percent():
first_number = self.numberBox.get()
global firstNumber
global mathType
mathType = "percent"
firstNumber = float(first_number)
self.numberBox.delete("0", "end")
def button_equal():
global firstNumber
if not self.numberBox.get():
second_number = 0.00
else:
second_number = self.numberBox.get()
self.numberBox.delete("0", "end")
if mathType == "addition":
total = firstNumber + float(second_number)
formatted = format_number(total)
self.numberBox.insert(0, formatted)
firstNumber = 0
if mathType == "subtraction":
total = firstNumber - float(second_number)
formatted = format_number(total)
self.numberBox.insert(0, formatted)
firstNumber = 0
if mathType == "multiplication":
total = firstNumber * float(second_number)
formatted = format_number(total)
self.numberBox.insert(0, formatted)
firstNumber = 0
if mathType == "division":
total = firstNumber / float(second_number)
formatted = format_number(total)
self.numberBox.insert(0, formatted)
firstNumber = 0
if mathType == "percent":
total = firstNumber / float(second_number) * 100
formatted = format_number(total)
self.numberBox.insert(0, formatted)
firstNumber = 0
# Calculator Frame
self.calcFrame = CTkFrame(self)
self.calcFrame.configure(width=300, height=480, corner_radius=10)
self.calcFrame.grid(row=0, column=0, sticky="n")
self.calcLabel = CTkLabel(self.calcFrame)
self.calcLabel.configure(justify="center", font=(App.numberBoxFont, 19), text="Total")
self.calcLabel.grid(row=0, column=0, columnspan=4)
self.numberBox = CTkEntry(self.calcFrame)
self.numberBox.configure(height=75, width=300, insertborderwidth=0, font=(App.numberBoxFont,
App.numberBoxFontSize),
state="normal", justify="center", placeholder_text="0")
self.numberBox.grid(row=1, column=0, columnspan=4)
self.calc_label_con = CTkLabel(self.calcFrame)
self.calc_label_con.configure(justify="center", font=(App.numberBoxFont, 12), text="Conversions")
self.calc_label_con.grid(row=2, column=0, columnspan=4)
self.cal_conv_m = CTkButton(self.calcFrame)
self.cal_conv_m.configure(text="MM → IN", width=146, height=30, font=(App.buttonFont, App.buttonFontSize),
fg_color=App.calcMathFG, command=lambda: convert("in"))
self.cal_conv_m.grid(row=3, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY, columnspan=2)
self.cal_conv_i = CTkButton(self.calcFrame)
self.cal_conv_i.configure(text="IN → MM", width=146, height=30, font=(App.buttonFont, App.buttonFontSize),
fg_color=App.calcMathFG, command=lambda: convert("mm"))
self.cal_conv_i.grid(row=3, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY, columnspan=2)
self.calc_label_keypad = CTkLabel(self.calcFrame)
self.calc_label_keypad.configure(justify="center", font=(App.numberBoxFont, 12), text="Keypad")
self.calc_label_keypad.grid(row=4, column=0, columnspan=4)
self.cal_1 = CTkButton(self.calcFrame)
self.cal_1.configure(text="1", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click(1))
self.cal_1.grid(row=7, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_2 = CTkButton(self.calcFrame)
self.cal_2.configure(text="2", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click(2))
self.cal_2.grid(row=7, column=1, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_3 = CTkButton(self.calcFrame)
self.cal_3.configure(text="3", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click(3))
self.cal_3.grid(row=7, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_4 = CTkButton(self.calcFrame)
self.cal_4.configure(text="4", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click(4))
self.cal_4.grid(row=6, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_5 = CTkButton(self.calcFrame)
self.cal_5.configure(text="5", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click(5))
self.cal_5.grid(row=6, column=1, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_6 = CTkButton(self.calcFrame)
self.cal_6.configure(text="6", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click(6))
self.cal_6.grid(row=6, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_7 = CTkButton(self.calcFrame)
self.cal_7.configure(text="7", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click(7))
self.cal_7.grid(row=5, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_8 = CTkButton(self.calcFrame)
self.cal_8.configure(text="8", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click(8))
self.cal_8.grid(row=5, column=1, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_9 = CTkButton(self.calcFrame)
self.cal_9.configure(text="9", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click(9))
self.cal_9.grid(row=5, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_0 = CTkButton(self.calcFrame)
self.cal_0.configure(text="0", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click(0))
self.cal_0.grid(row=8, column=1, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_dec = CTkButton(self.calcFrame)
self.cal_dec.configure(text=".", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=lambda: button_click('.'))
self.cal_dec.grid(row=8, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_perc = CTkButton(self.calcFrame)
self.cal_perc.configure(text="%", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcNumberFG,
command=button_percent)
self.cal_perc.grid(row=8, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_div = CTkButton(self.calcFrame)
self.cal_div.configure(text="÷", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcMathFG,
command=lambda: calculate("div"))
self.cal_div.grid(row=8, column=3, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_mult = CTkButton(self.calcFrame)
self.cal_mult.configure(text="x", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcMathFG,
command=lambda: calculate("mult"))
self.cal_mult.grid(row=5, column=3, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_sub = CTkButton(self.calcFrame)
self.cal_sub.configure(text="-", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcMathFG,
command=lambda: calculate("sub"))
self.cal_sub.grid(row=6, column=3, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_add = CTkButton(self.calcFrame)
self.cal_add.configure(text="+", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcMathFG,
command=lambda: calculate("add"))
self.cal_add.grid(row=7, column=3, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_clear = CTkButton(self.calcFrame)
self.cal_clear.configure(text="CLEAR", width=146, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize), fg_color=App.calcClearFG,
command=lambda: clear("calc"))
self.cal_clear.grid(row=9, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY, columnspan=2)
self.cal_equal = CTkButton(self.calcFrame)
self.cal_equal.configure(text="=", width=146, height=App.calcHeight, font=(App.buttonFont, App.buttonFontSize),
command=button_equal)
self.cal_equal.grid(row=9, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY, columnspan=2)
self.calc_label_frac = CTkLabel(self.calcFrame)
self.calc_label_frac.configure(justify="center", font=(App.numberBoxFont, 12), text="Fractions")
self.calc_label_frac.grid(row=10, column=0, columnspan=4)
self.cal_eighth = CTkButton(self.calcFrame)
self.cal_eighth.configure(text="", width=App.calcWidth, height=5, font=(App.buttonFont, 12),
command=lambda: button_click(".125"))
self.cal_eighth.grid(row=11, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_quarter = CTkButton(self.calcFrame)
self.cal_quarter.configure(text="¼", width=App.calcWidth, height=5, font=(App.buttonFont, 12),
command=lambda: button_click(".25"))
self.cal_quarter.grid(row=11, column=1, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_half = CTkButton(self.calcFrame)
self.cal_half.configure(text="½", width=App.calcWidth, height=5, font=(App.buttonFont, 12),
command=lambda: button_click(".5"))
self.cal_half.grid(row=11, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.cal_inch = CTkButton(self.calcFrame)
self.cal_inch.configure(text="¾", width=App.calcWidth, height=5, font=(App.buttonFont, 12),
command=lambda: button_click(".75"))
self.cal_inch.grid(row=11, column=3, padx=App.calcPaddingX, pady=App.calcPaddingY)
# END Calculator Frame
# Adjustments Frame
self.adjustments = CTkFrame(self)
self.adjustments.configure(width=370, height=160, corner_radius=10)
self.adjustments.grid(row=0, column=1, sticky="nw")
# Fence Frame
self.adjustments.frame_fence = CTkFrame(self.adjustments)
self.adjustments.frame_fence.configure(width=500, height=160, corner_radius=10)
self.adjustments.frame_fence.grid(row=0, column=1, sticky="nw")
self.fence_label = CTkLabel(self.adjustments.frame_fence)
self.fence_label.configure(justify="center", font=(App.numberBoxFont, 19), text="Fence")
self.fence_label.grid(row=0, column=0, columnspan=2)
self.fence_label_location = CTkLabel(self.adjustments.frame_fence)
self.fence_label_location.configure(justify="center", font=(App.numberBoxFont, 12), text="Current")
self.fence_label_location.grid(row=1, column=0, columnspan=1)
self.fence_label_final = CTkLabel(self.adjustments.frame_fence)
self.fence_label_final.configure(justify="center", font=(App.numberBoxFont, 12), text="Destination")
self.fence_label_final.grid(row=1, column=1, columnspan=1)
self.fenceLocation = CTkEntry(self.adjustments.frame_fence)
self.fenceLocation.configure(height=40, width=100, font=(App.numberBoxFont, 12), state="normal",
justify="center", placeholder_text="0")
self.fenceLocation.grid(row=2, column=0, columnspan=1)
self.fenceDestination = CTkEntry(self.adjustments.frame_fence)
self.fenceDestination.configure(height=40, width=100, font=(App.numberBoxFont, 12), state="normal",
justify="center", placeholder_text="0")
self.fenceDestination.grid(row=2, column=1, columnspan=1)
self.fenceGrabLocation = CTkButton(self.adjustments.frame_fence)
self.fenceGrabLocation.configure(text="→ Current", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize),
command=lambda: import_to("fence", "current_location"))
self.fenceGrabLocation.grid(row=3, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.fenceGrabGo = CTkButton(self.adjustments.frame_fence, )
self.fenceGrabGo.configure(text="→ Destination", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize),
command=lambda: import_to("fence", "destination_location"))
self.fenceGrabGo.grid(row=3, column=1, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.fenceGo = CTkButton(self.adjustments.frame_fence)
self.fenceGo.configure(text="GO!!", fg_color="green", hover_color="darkgreen", width=App.calcWidth,
height=App.calcHeight, font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.fenceGo.grid(row=2, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
# END Fence Frame
# Angle Frame
self.adjustments.frame_angle = CTkFrame(self.adjustments)
self.adjustments.frame_angle.configure(width=500, height=160, corner_radius=10)
self.adjustments.frame_angle.grid(row=1, column=1, sticky="nw")
self.angleLabel = CTkLabel(self.adjustments.frame_angle)
self.angleLabel.configure(justify="center", font=(App.numberBoxFont, 19), text="Angle")
self.angleLabel.grid(row=0, column=0, columnspan=2)
self.angleLabelCurrent = CTkLabel(self.adjustments.frame_angle)
self.angleLabelCurrent.configure(justify="center", font=(App.numberBoxFont, 12), text="Current")
self.angleLabelCurrent.grid(row=1, column=0, columnspan=1)
self.angleLabelDestination = CTkLabel(self.adjustments.frame_angle)
self.angleLabelDestination.configure(justify="center", font=(App.numberBoxFont, 12), text="Destination")
self.angleLabelDestination.grid(row=1, column=1, columnspan=1)
self.angleCurrentNumber = CTkEntry(self.adjustments.frame_angle)
self.angleCurrentNumber.configure(height=40, width=100, font=(App.numberBoxFont, 12), state="normal",
justify="center", placeholder_text="0")
self.angleCurrentNumber.grid(row=2, column=0, columnspan=1)
self.angleDestinationNumber = CTkEntry(self.adjustments.frame_angle)
self.angleDestinationNumber.grid(row=2, column=1, columnspan=1)
self.angleDestinationNumber.configure(height=40, width=100, font=(App.numberBoxFont, 12), state="normal",
justify="center", placeholder_text="0")
self.angleGrabCurrent = CTkButton(self.adjustments.frame_angle)
self.angleGrabCurrent.configure(text="→ Current", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize),
command=lambda: import_to("angle", "current_location"))
self.angleGrabCurrent.grid(row=3, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.angleGrabGo = CTkButton(self.adjustments.frame_angle)
self.angleGrabGo.configure(text="→ Destination", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize),
command=lambda: import_to("angle", "destination_location"))
self.angleGrabGo.grid(row=3, column=1, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.angleGoZero = CTkButton(self.adjustments.frame_angle)
self.angleGoZero.configure(text="", fg_color="green", hover_color="darkgreen", width=App.calcWidth,
height=App.calcHeight, font=(App.buttonFont, App.buttonFontSize),
command=self.settings)
self.angleGoZero.grid(row=1, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.angleGo45 = CTkButton(self.adjustments.frame_angle, text="45", width=App.calcWidth,
height=App.calcHeight, font=(App.buttonFont, App.buttonFontSize),
command=self.settings)
self.angleGo45.configure(text="45°", fg_color="green", hover_color="darkgreen", width=App.calcWidth,
height=App.calcHeight, font=(App.buttonFont, App.buttonFontSize),
command=self.settings)
self.angleGo45.grid(row=2, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.angleGo = CTkButton(self.adjustments.frame_angle)
self.angleGo.configure(text="GO!!", fg_color="green", hover_color="darkgreen", width=App.calcWidth,
height=App.calcHeight, font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.angleGo.grid(row=3, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
# END Angle Frame
# Height Frame
self.adjustments.frame_height = CTkFrame(self.adjustments)
self.adjustments.frame_height.configure(width=500, height=160, corner_radius=10)
self.adjustments.frame_height.grid(row=2, column=1, sticky="nw")
self.heightLabel = CTkLabel(self.adjustments.frame_height, justify="center", font=(App.numberBoxFont, 19),
text="Height")
self.heightLabel.configure(justify="center", font=(App.numberBoxFont, 19), text="Height")
self.heightLabel.grid(row=0, column=0, columnspan=2)
self.heightLabelCurrent = CTkLabel(self.adjustments.frame_height, justify="center",
font=(App.numberBoxFont, 12), text="Current")
self.heightLabelCurrent.configure(justify="center", font=(App.numberBoxFont, 12), text="Current")
self.heightLabelCurrent.grid(row=1, column=0, columnspan=1)
self.heightLabelDestination = CTkLabel(self.adjustments.frame_height)
self.heightLabelDestination.configure(justify="center", font=(App.numberBoxFont, 12), text="Destination")
self.heightLabelDestination.grid(row=1, column=1, columnspan=1)
self.heightCurrentNumber = CTkEntry(self.adjustments.frame_height)
self.heightCurrentNumber.configure(height=40, width=100, font=(App.numberBoxFont, 12), state="normal",
justify="center", placeholder_text="0")
self.heightCurrentNumber.grid(row=2, column=0, columnspan=1)
self.heightDestinationNumber = CTkEntry(self.adjustments.frame_height)
self.heightDestinationNumber.configure(height=40, width=100, font=(App.numberBoxFont, 12), state="normal",
justify="center", placeholder_text="0")
self.heightDestinationNumber.grid(row=2, column=1, columnspan=1)
self.heightGrabCurrent = CTkButton(self.adjustments.frame_height)
self.heightGrabCurrent.configure(text="→ Current", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize),
command=lambda: import_to("height", "current_location"))
self.heightGrabCurrent.grid(row=3, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.heightGrabGo = CTkButton(self.adjustments.frame_height)
self.heightGrabGo.configure(text="→ Destination", width=App.calcWidth, height=App.calcHeight,
font=(App.buttonFont, App.buttonFontSize),
command=lambda: import_to("height", "destination_location"))
self.heightGrabGo.grid(row=3, column=1, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.heightGoZero = CTkButton(self.adjustments.frame_height)
self.heightGoZero.configure(text="0''", fg_color="green", hover_color="darkgreen", width=App.calcWidth,
height=App.calcHeight, font=(App.buttonFont, App.buttonFontSize),
command=self.settings)
self.heightGoZero.grid(row=1, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.heightGo01 = CTkButton(self.adjustments.frame_height)
self.heightGo01.configure(text="1''", fg_color="green", hover_color="darkgreen", width=App.calcWidth,
height=App.calcHeight, font=(App.buttonFont, App.buttonFontSize),
command=self.settings)
self.heightGo01.grid(row=2, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.heightGo = CTkButton(self.adjustments.frame_height)
self.heightGo.configure(text="GO!!", fg_color="green", hover_color="darkgreen", width=App.calcWidth,
height=App.calcHeight, font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.heightGo.grid(row=3, column=2, padx=App.calcPaddingX, pady=App.calcPaddingY)
# END Height Frame
# END Adjustments Frame
# Presets Frame
self.presetsFrame = CTkFrame(self)
self.presetsFrame.configure(width=130, height=480, corner_radius=10)
self.presetsFrame.grid(row=0, column=2, sticky="n")
self.presetsLabel = CTkLabel(self.presetsFrame)
self.presetsLabel.configure(justify="center", font=(App.numberBoxFont, 19), text="Presets")
self.presetsLabel.grid(row=0, column=0, columnspan=1)
self.preset01 = CTkButton(self.presetsFrame)
self.preset01.configure(text="1", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT,
font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.preset01.grid(row=1, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.preset02 = CTkButton(self.presetsFrame)
self.preset02.configure(text="2", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT,
font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.preset02.grid(row=2, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.preset03 = CTkButton(self.presetsFrame)
self.preset03.configure(text="3", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT,
font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.preset03.grid(row=3, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.preset04 = CTkButton(self.presetsFrame)
self.preset04.configure(text="4", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT,
font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.preset04.grid(row=4, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.preset05 = CTkButton(self.presetsFrame)
self.preset05.configure(text="5", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT,
font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.preset05.grid(row=5, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.preset06 = CTkButton(self.presetsFrame)
self.preset06.configure(text="6", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT,
font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.preset06.grid(row=6, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.preset07 = CTkButton(self.presetsFrame)
self.preset07.configure(text="7", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT,
font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.preset07.grid(row=7, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.preset08 = CTkButton(self.presetsFrame)
self.preset08.configure(text="8", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT,
font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.preset08.grid(row=8, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.preset09 = CTkButton(self.presetsFrame)
self.preset09.configure(text="9", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT,
font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.preset09.grid(row=9, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
self.preset10 = CTkButton(self.presetsFrame)
self.preset10.configure(text="10", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT,
font=(App.buttonFont, App.buttonFontSize), command=self.settings)
self.preset10.grid(row=10, column=0, padx=App.calcPaddingX, pady=App.calcPaddingY)
def settings(self):
def close_set():
settings.destroy()
settings = CTkToplevel(self)
settings.geometry("400x200")
# create label on CTkToplevel window
label = CTkLabel(settings, text="Settings")
label.pack(side="top", fill="both", expand=True, padx=40, pady=40)
settings.s_quit = CTkButton(settings, text="Quit", command=close_set)
settings.s_quit.pack(side="top", padx=40, pady=40)
if __name__ == '__main__':
app = App()
app.mainloop()