1. wxEuphoria: Using wxEVT_ACTIVATE_APP
- Posted by euphoric (admin) Jul 18, 2018
- 1046 views
Is there an event that fires only once upon app start?
I'm looking at the wxEVT_ACTIVATE_APP event, but not sure how to use it. It doesn't seem to work with my main frame:
set_event_handler( myFrame, -1, wxEVT_ACTIVATE_APP, routine_id("app_activate"))
2. Re: wxEuphoria: Using wxEVT_ACTIVATE_APP
- Posted by ghaberek (admin) Jul 18, 2018
- 1060 views
Is there an event that fires only once upon app start?
I'm looking at the wxEVT_ACTIVATE_APP event, but not sure how to use it. It doesn't seem to work with my main frame:
set_event_handler( myFrame, -1, wxEVT_ACTIVATE_APP, routine_id("app_activate"))
The verbiage of "app" here is ambiguous. According to the documentation, it's meant to trigger wxActivateEvent events against the wxApp class, instead of the wxWindow class.
Either way, I'm pretty sure wxActivateEvent events fire off every time the window is activated or deactivated, which is similar-but-not-quite the same as focus/blurred.
If you want to fire an event once when your wxFrame is shown, I would just keep a flag and then ignore the event on further triggers.
integer app_activated = wxFalse procedure myFrame_OnShow( atom this, atom event_type, atom id, atom event ) if app_activated then skip( event ) return end if -- do activation stuff here app_activated = wxTrue end procedure set_event_handler( myFrame, -1, wxEVT_SHOW, routine_id("myFrame_OnShow") )
-Greg
3. Re: wxEuphoria: Using wxEVT_ACTIVATE_APP
- Posted by euphoric (admin) Jul 18, 2018
- 1046 views
If you want to fire an event once when your wxFrame is shown, I would just keep a flag and then ignore the event on further triggers.
ha! That's exactly what I'm doing. I was just hoping to clean up the code a bit with an event on app starting, and when I saw the wxEVT_ACTIVATE_APP event, I thought I could.
Thank you!