7 Oct 07:34
Handling socket events?
From: Evan DeMond <evan.demond@...>
Subject: Handling socket events?
Newsgroups: gmane.comp.lib.wxwidgets.wxlua.user
Date: 2008-10-07 05:35:38 GMT
Subject: Handling socket events?
Newsgroups: gmane.comp.lib.wxwidgets.wxlua.user
Date: 2008-10-07 05:35:38 GMT
Hi all,
I'm writing a wxLua app which needs socket functionality, and I'm having trouble figuring out how to handle events from wxSocketClient. wxSocketBase doesn't inherit from wxEvtHandler, meaning Connect() isn't an option. I went looking and found this:
http://docs.wxwidgets.org/stable/wx_wxsocketbase.html#socketevents
http://docs.wxwidgets.org/stable/wx_wxsocketbase.html#wxsocketbaseseteventhandler
So I tried to set up a plain wxEvtHandler object, hooking it up to the wxSocketClient with SetEventHandler(), and trying to Connect() the wxEvtHandler to wxSOCKET_INPUT - but that apparently fails?
"Lua: Error while running chunk
...
wxLua: Invalid or unknown wxEventType for wxEvtHandler::Connect() : 0, winIds -1, -1."
I can't seem to find any example code using wxSocketClient in Lua anywhere. All the C++ code I've seen uses the EVT_SOCKET macro, but that's not available in pure Lua.
I'm stumped. How does one receive wxSocketClient events in a wxLua program?
Thanks,
Evan
I'm writing a wxLua app which needs socket functionality, and I'm having trouble figuring out how to handle events from wxSocketClient. wxSocketBase doesn't inherit from wxEvtHandler, meaning Connect() isn't an option. I went looking and found this:
http://docs.wxwidgets.org/stable/wx_wxsocketbase.html#socketevents
http://docs.wxwidgets.org/stable/wx_wxsocketbase.html#wxsocketbaseseteventhandler
So I tried to set up a plain wxEvtHandler object, hooking it up to the wxSocketClient with SetEventHandler(), and trying to Connect() the wxEvtHandler to wxSOCKET_INPUT - but that apparently fails?
"Lua: Error while running chunk
...
wxLua: Invalid or unknown wxEventType for wxEvtHandler::Connect() : 0, winIds -1, -1."
I can't seem to find any example code using wxSocketClient in Lua anywhere. All the C++ code I've seen uses the EVT_SOCKET macro, but that's not available in pure Lua.
I'm stumped. How does one receive wxSocketClient events in a wxLua program?
Thanks,
Evan
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ wxlua-users mailing list wxlua-users@... https://lists.sourceforge.net/lists/listinfo/wxlua-users
RSS Feed