from tkinter import *
from tkinter import ttk

#This is tha main window usulayy called Root
root = Tk()
root.title("simple Calculator")

numButtonSizeX=10
numButtonSizeY=10
calcScreenSize=50
buttonPerRow=3
paddingX=10
paddingY=10
buttonPaddingX=50
buttonPaddingY=20
boderSize=5

#FUNCTIONS It doenst matter if this is before the decalaritions(PYthon Thing). 
def buttonClick(number): 
    screen.insert(0,number)
# Creating a widget label
#Labels
#Buttons
button1 = Button(root, text="1", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick(1))
button2 = Button(root, text="2", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick(2))
button3 = Button(root, text="3", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick(3))
button4 = Button(root, text="4", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick(4))
button5 = Button(root, text="5", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick(5))
button6 = Button(root, text="6", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick(6))
button7 = Button(root, text="7", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick(7))
button8 = Button(root, text="8", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick(8))
button9 = Button(root, text="9", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick(9))
button0 = Button(root, text="0", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick(0))
buttonPlus = Button(root, text="+", padx=buttonPaddingX,pady=buttonPaddingY, command=lambda: buttonClick())
buttonClear = Button(root, text="Clear", padx=buttonPaddingX*2,pady=buttonPaddingY, command=lambda: buttonClick())
buttonEqual = Button(root, text="=", padx=buttonPaddingX*2,pady=buttonPaddingY, command=lambda: buttonClick())
 
#Entry
screen = Entry(root, width=calcScreenSize, borderwidth=boderSize)
screen.grid(row=0, column=0, columnspan=buttonPerRow, padx=paddingX, pady=paddingY)

#Showing on the screen and aranging them
button1.grid(row=1, column=0)
button2.grid(row=1, column=1)
button3.grid(row=1, column=2)

button4.grid(row=2, column=0)
button5.grid(row=2, column=1)
button6.grid(row=2, column=2)

button7.grid(row=3, column=0)
button8.grid(row=3, column=1)
button9.grid(row=3, column=2)

button0.grid(row=4, column=0)
buttonClear.grid(row=4, column=1, columnspan=2)
buttonPlus.grid(row=5, column=0)
buttonEqual.grid(row=5, column=1, columnspan=2)

#Main Loop Equivalent of our main(); 
root.mainloop()


