Pregunta

In order to refresh my GUI, sometimes self.Refresh(), self.Layout() doesn't produce the result I want.

The only thing that worked and really refreshed the GUI is : manually triggering a wx.EVT_SIZE with

s = self.GetSize()
self.SetSize((0,0))
self.SetSize(s)

Is there a cleaner way of manually triggering a wx.EVT_SIZE ?

¿Fue útil?

Solución

Use wxWindow::PostSizeEvent().

Notice, however, that if you avoided the manual handling of wxEVT_SIZE (which you seem to be doing based on your other questions) and just used sizers, then a simple Layout() would be enough.

And, FWIW, Refresh() has nothing to do with size at all, it just results in repainting the window, i.e. can be used to trigger a call to your wxEVT_PAINT, not wxEVT_SIZE, handler.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top