On Sun, Jun 13, 2010 at 2:26 AM, Chunlin Zhang <[email protected]> wrote:
> 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)
print(self.button, type(self.button))
print(self.textEntry, type(self.textEntry))
print(self.co, type(self.co))
> 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 ?
I really don't know, if you print the type of self.button you get that
it's a "string", same with self.co. I will look into the code that
does the lookup for the value, somehow it's getting replaced with the
key for the table?
Regards,
John
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users