from tkinter import *
def drag_start(event):
widget = event.widget
widget.startX = event.x
widget.startY = event.y
def drag_motion(event):
widget = event.widget
x = widget.winfo_x() - widget.startX + event.x
y = widget.winfo_y() - widget.startY + event.y
widget.place(x=x,y=y)
screen = Tk()
screen.attributes('-fullscreen',True)
label = Label(screen,bg="red",width=10, height=4)
label.place(x=0,y=0)
label2 = Label(screen,bg="blue",width=10, height=4)
label2.place(x=100,y=100)
label.bind("<Button-1>",drag_start)
label.bind("<B1-Motion>",drag_motion)
label2.bind("<Button-1>",drag_start)
label2.bind("<B1-Motion>",drag_motion)
screen.configure(background="black")
background_image = PhotoImage(file='bg1.png')
background = Label(screen, image=background_image)
background.pack()
screen.mainloop()
i hve added the image you will need