[wxMax] Application inactivity timeout

BlitzMax Forums/Brucey's Modules/[wxMax] Application inactivity timeout

plash(Posted 2010) [#1]
I'm trying to setup automatic-logout with wxMax, but there seems to be no way in the wrapper to do it.
Searching around, someone mentioned something about wxApp::FilterEvent, but didn't say how it was used (and wxApp.FilterEvent does not exist - although there is commented-out code for it).
An easy way to do it would be to connect every event to a single function, but I haven't found a way to do that with one call (i.e. ConnectAny(wxEVT_ALL, OnEvent)).

I thought of a way to do it by rewriting TEventHandler.eventCallback (calling a separate callback for each event), but I would rather not modify wxMax.. it takes forever to compile.

Anyone have some suggestions?


DavidDC(Posted 2010) [#2]
I don't have any answers, just clarifying the question - you want your app to close or otherwise elegantly cope when the user logs off?


Tommo(Posted 2010) [#3]
This code works on winxp.
I'm not sure about other platform.




Brucey(Posted 2010) [#4]
You need to subclass wxApp and implement FilterEvent yourself - to catch those events you are interested in.

Of course... that'll only be true once I've got it working properly.
It's a bit... um... complicated down there. I need to retrieve correct evthandler object, and then try to find the event object of the right type - which may, or may not work...


Brucey(Posted 2010) [#5]
Yes, the idle timer is also a good idea :-)


plash(Posted 2010) [#6]
I don't have any answers, just clarifying the question - you want your app to close or otherwise elegantly cope when the user logs off?
I want to do some action (clear cached user-data, "logout" [not from the OS], etc.) when no events have been created for x amount of time (application is idle).

@Tommo: Thanks! That's exactly what I was trying to do.. though I never thought of doing it like that.

EDIT: Sadly, though, it does not work on Ubuntu :(


Tommo(Posted 2010) [#7]

it does not work on Ubuntu :(


I've no linux here... sorry

Maybe you can write a simple customed wxEvtHandler in C++, and import it into your bmx app.
In such way you don't have to modify wx.mod.


Brucey(Posted 2010) [#8]
filterEvent is going to require some major work on the framework... ho hum.

My head is spinning :-p

Watch this space...


plash(Posted 2010) [#9]
*still watching*