Page 1 of 1

wxEVT_MOVE_END equivalent for GTK

Posted: Wed Jun 19, 2019 1:49 pm
by Maeglix
Hello every one,

In my app, i need to update a list (wxListCtrl) when the main app window is re-sized (either when the user re-sizes it manually or with the maximize / minimize button). The thing is I don't need and don't want to update it for each pixel of the re-size, so I can't just catch the size event. I would like to update it when the user finishes the re-size. I saw the wxEVT_MOVE_EVT which seemed to be what I need, but it is implemented only on MSW. So I would like to know if there is some equivalent of it on GTK or if there was a way to do it myself.

Thanks for your help.

Re: wxEVT_MOVE_END equivalent for GTK

Posted: Wed Jun 19, 2019 3:01 pm
by doublemax
I would catch the wxEVT_SIZE event and start a one-shot timer with about 200-400ms delay in the event handler. As long as the user is resizing, the timer will be restarted and not fire. In the timer event handler do the time consuming update.

Re: wxEVT_MOVE_END equivalent for GTK

Posted: Fri Jun 21, 2019 6:28 am
by Maeglix
Thanks ! It worked.

Re: wxEVT_MOVE_END equivalent for GTK

Posted: Sat Jun 22, 2019 9:50 pm
by Mick P.
I think it sends wxEVT_MOVE only after the window is released from moving? It certainly looks that way, but it may depend on if the session is remote or other factors. I'm curious to know if that's the case.