<code>from tkinter import *
root = Tk()
root.geometry("1600x800+0+0")
root.title("my notepad")
Tops = Frame(root, width=1650, height=50, bg="light green", relief=SUNKEN)
Tops.pack(side=TOP)
note = StringVar()
Bottom = Frame(root, width=1600, height=655, bg="light blue", relief=SUNKEN)
Bottom.pack(side=BOTTOM, fill=BOTH, expand=True) # Adjusted pack parameters
txtstotal = Entry(Bottom, font=('arial', 20, 'bold'), textvariable=note, bd=10, insertwidth=4,
bg="light blue", justify="left")
txtstotal.pack(fill=BOTH, expand = True)
root.mainloop()
</code>
<code>from tkinter import *
root = Tk()
root.geometry("1600x800+0+0")
root.title("my notepad")
Tops = Frame(root, width=1650, height=50, bg="light green", relief=SUNKEN)
Tops.pack(side=TOP)
note = StringVar()
Bottom = Frame(root, width=1600, height=655, bg="light blue", relief=SUNKEN)
Bottom.pack(side=BOTTOM, fill=BOTH, expand=True) # Adjusted pack parameters
txtstotal = Entry(Bottom, font=('arial', 20, 'bold'), textvariable=note, bd=10, insertwidth=4,
bg="light blue", justify="left")
txtstotal.pack(fill=BOTH, expand = True)
root.mainloop()
</code>
from tkinter import *
root = Tk()
root.geometry("1600x800+0+0")
root.title("my notepad")
Tops = Frame(root, width=1650, height=50, bg="light green", relief=SUNKEN)
Tops.pack(side=TOP)
note = StringVar()
Bottom = Frame(root, width=1600, height=655, bg="light blue", relief=SUNKEN)
Bottom.pack(side=BOTTOM, fill=BOTH, expand=True) # Adjusted pack parameters
txtstotal = Entry(Bottom, font=('arial', 20, 'bold'), textvariable=note, bd=10, insertwidth=4,
bg="light blue", justify="left")
txtstotal.pack(fill=BOTH, expand = True)
root.mainloop()
Here in the line txtstotal.pack(fill=BOTH, expand = True), I made the entry widget to the size of the full screen, but the problem is because of doing that, the cursor is now at the center of the screen, which I don’t want. I want a big entry widget, but the cursor starts from the top like normal.
Wwhat should I do?
New contributor
vatsal agrawal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.