notatallshaw / fall_guys_ping_estimate

MIT License
40 stars 6 forks source link

Make Window Dragable #6

Open notatallshaw opened 3 years ago

notatallshaw commented 3 years ago

Investigate if it's possible to make the window dragable. If so, record the last position the user dragged it to so that next time it's opened it will be opened in that position.

geniusonanotherlevel commented 5 months ago

Try this:

self.ping_label.bind('',self.setOffset) self.ping_label.bind('',self.dragWindow)

def dragWindow(self,event): x = self.winfo_pointerx() - self._offsetx y = self.winfo_pointery() - self._offsety self.geometry('+{x}+{y}'.format(x=x,y=y))

def setOffset(self,event): self._offsetx = event.x self._offsety = event.y

notatallshaw commented 5 months ago

Cool idea, I'll try and look today, I was planning to push a small release that just fixes up some code soon anyway.

geniusonanotherlevel commented 5 months ago

btw, you might have noticed some text missing in my comment above:

self.ping_label.bind('Button-1 ... self.ping_label.bind('B1-Motion ...

I think it was probably due to the less & greater than signs ..

Also, in your code, it might be self.root.winfo...