Event when resize has finished?
Event when resize has finished?
I catch OnSize in my top-frame, but it seems to be caught after the main window is resized, but before the rest of the app has been updated. Is there an easy way to be notified after everything has been updated?
-
- Super wx Problem Solver
- Posts: 401
- Joined: Wed Sep 21, 2005 8:17 am
- Location: Rostov-on-Don, Southern Russia
Re: Event when resize has finished?
You can try OnPaint eventJohnD wrote:I catch OnSize in my top-frame, but it seems to be caught after the main window is resized, but before the rest of the app has been updated. Is there an easy way to be notified after everything has been updated?
Win XP HE SP3, Vista
Xubuntu 12.04 LTS
wxWidgets-2.9.5
wxWidgets-3.0.0
Xubuntu 12.04 LTS
wxWidgets-2.9.5
wxWidgets-3.0.0
Re: Event when resize has finished?
I need to know the paint event is because of the resize in that case.
Re: Event when resize has finished?
There is no event for that. If you want to skip the redraw while the window is still being resized, the only chance is to manually check if the mouse button is down.
Use the source, Luke!
Re: Event when resize has finished?
It's not specifically during a prolonged resize, even maximizing the window gets this effect... OnSize is called before the layout is updated. I want to evaluate the size of a child control, prompted by the resize, but after everything is recalculated. There's no way to catch this?
Re: Event when resize has finished?
Hi,
AFAIK there's no simple way to do that. However you should be able to do it unsimply .
For example, catch (and Skip()) the child control's size event (though you could use the frame's, I suppose). In the handler start a single-shot timer with a reasonable interval e.g. 100ms; you'll need to experiment. Arrange for your recalculation to happen when the timer fires.
As wxTimer::Start stops and restarts a timer, this means that all but the last of multiple size events will be ignored.
Regards,
David
AFAIK there's no simple way to do that. However you should be able to do it unsimply .
For example, catch (and Skip()) the child control's size event (though you could use the frame's, I suppose). In the handler start a single-shot timer with a reasonable interval e.g. 100ms; you'll need to experiment. Arrange for your recalculation to happen when the timer fires.
As wxTimer::Start stops and restarts a timer, this means that all but the last of multiple size events will be ignored.
Regards,
David
-
- wxWorld Domination!
- Posts: 1059
- Joined: Sun Dec 30, 2007 6:40 pm
- Location: Canada
Re: Event when resize has finished?
Hi,
Additionally to David's suggestion, you could catch the wxIdleEvent which is sent after UI activity has settled down.
Check http://docs.wxwidgets.org/stable/wx_wxidleevent.html
Good luck,
Jim
Additionally to David's suggestion, you could catch the wxIdleEvent which is sent after UI activity has settled down.
Check http://docs.wxwidgets.org/stable/wx_wxidleevent.html
Good luck,
Jim
OS: Vista SP1, wxWidgets 2.8.7.
Re: Event when resize has finished?
You reckon the first Idle event after OnSize would be guaranteed to be the one I want?JimFairway wrote:Hi,
Additionally to David's suggestion, you could catch the wxIdleEvent which is sent after UI activity has settled down.
Check http://docs.wxwidgets.org/stable/wx_wxidleevent.html
Good luck,
Jim
-
- wxWorld Domination!
- Posts: 1059
- Joined: Sun Dec 30, 2007 6:40 pm
- Location: Canada
Re: Event when resize has finished?
Yes, I reckon. The event happens when the main loop has nothing left to do.
Worth a shot.
Jim
Worth a shot.
Jim
OS: Vista SP1, wxWidgets 2.8.7.