From: Chunlin Z. <zha...@gm...> - 2010-06-13 06:27:17
|
Dear all: I have just encountered this kind of issue,using wxlua in Lua for windows (LuaForWindows_v5.1.4-36).I extend class using the method mentioned in "Extending classes" of http://wxlua.sourceforge.net/docs/wxlua.html. In the attatchment of file "veryminimal.wx.wlua",I wrote a coroutine function in a button handler. """ function mainframe_on_button(self,event) print("---outside coroutine") print(self) print(self.button) print(self.textEntry) local function test_co_func() print("---inside coroutine") print(self) print(self.button) print(self.textEntry) end self.co = coroutine.create(test_co_func) local r,e = coroutine.resume(self.co) if (r == false) then print(r,e) end end """ And the output is: """ ---outside coroutine userdata: 016454F8 [wxFrame(01645138, 186)] userdata: 016462F0 [wxButton(01646160, 109)] userdata: 01645D98 [wxTextCtrl(01645BA0, 337)] ---inside coroutine userdata: 016454F8 [wxFrame(01645138, 186)] button textEntry """ Why can not access the right value in coroutine ? Thanks! |