- Joined
- Jun 9, 2024
- Messages
- 3
- Reaction score
- 0
hello everyone i have a problem with my code i am making a calculator using tkinter so the problem is that there is a label called 'one_button' which won't stick to the left border of the screen here is the code:
from tkinter import *
import tkinter
top = tkinter.Tk()
top.title("calculator")
top.geometry("600x640")
top.configure(bg="grey")
res = Frame(top)
row1 = Frame(top)
row2 = Frame(top)
row3 = Frame(top)
result_area = Text(res, width=75, height=7)
def one_pressed():
pass
one_button = Button(row1, text="1", command=one_pressed, width=10, height=4)
res.grid(row=0, column=0, columnspan=3)
row1.grid(row=1, column=0, columnspan=3)
row2.grid(row=2, column=0, columnspan=3)
row3.grid(row=3, column=0, columnspan=3)
result_area.grid(row=0, column=0, padx=10, pady=10)
one_button.grid(row=0, column=1, padx=10, pady=12, sticky='w')
top.mainloop()
i hope you can help me
from tkinter import *
import tkinter
top = tkinter.Tk()
top.title("calculator")
top.geometry("600x640")
top.configure(bg="grey")
res = Frame(top)
row1 = Frame(top)
row2 = Frame(top)
row3 = Frame(top)
result_area = Text(res, width=75, height=7)
def one_pressed():
pass
one_button = Button(row1, text="1", command=one_pressed, width=10, height=4)
res.grid(row=0, column=0, columnspan=3)
row1.grid(row=1, column=0, columnspan=3)
row2.grid(row=2, column=0, columnspan=3)
row3.grid(row=3, column=0, columnspan=3)
result_area.grid(row=0, column=0, padx=10, pady=10)
one_button.grid(row=0, column=1, padx=10, pady=12, sticky='w')
top.mainloop()
i hope you can help me