AWolf
AWolf

Reputation: 8990

How to write a handler for window move event in Kivy?

I'd like to write a handler for the event after the window is moved in Windows / Linux.

I need such a function to reset the behaviour of my app because dragging of the window will stop/pause all Clock.schedules and after the window is released the animation with the schedule is not starting properly. The wrong behaviour during window move is no problem but afterwards the app should restart correctly.

Something simillar to this code for window resize:

class DemoApp(App):
    def build(self):
        def win_cb(window, width, height):
           print 'resizing'

        Window.bind(on_resize=win_cb)

Is there something like on_move? I haven't seen anything like that in the api-documentation

Upvotes: 1

Views: 979

Answers (1)

kitti
kitti

Reputation: 14834

No, there is no way to get the current window position in Kivy. It may be possible by directly utilizing the window backend (i.e. pygame) but this is not cross-platform compatible and is quite hacky.

However, you're definitely having some other problem here. Animations and Clock schedules both work fine for me while moving and resizing the window. You might want to post another question asking why your schedules are getting screwed up, because this is not expected behavior.

Upvotes: 1

Related Questions