I got a canvas field and need a text input box, but I don't find a working solution. There is an entry field now but center North and I need this entry field on the left site and i don't know how to position this entry field.
GUI = Tk()
GUI.configure(background="#002E52")
GUI.title('Templatewriter')
GUI.geometry("1920x1080")
e = Entry(GUI)
e.pack()
e.delete(0, END)
e.insert(0, "Überschrift eingeben")
box2 = Canvas(GUI, width=200, height=50)
box2.pack()
box2.place(x=0, y=0)
box2.create_text((50, 25), text="Überschrift 1 ", fill="black")
linie = Canvas(GUI, width=10, height=1080)
linie.pack()
box1 = Canvas(GUI, width=1920, height=1080)
box1.pack()
GUI.mainloop()
Is there anyway to do it?
Try not to mix different layout managers, it becomes messy.
Instead of packing, use the grid() or place() method. Since the layout in your program is simple, it would be more efficient to use grid().
object = Canvas(GUI, etc.)
object.grid(row = 1, column = 1)
The grid method works like battleship. You specify the row and column, and the objects are placed there.
The place() method is more precise (You already have it in use). I would recommend using this throughout the program if there are specific measurements.
object = Canvas(GUI, etc.)
object.place(x = 30, y = 50)
Additional info here: http://zetcode.com/gui/tkinter/layout/