Interesting.

 This also does not work:

function box[key].click_cb(self, L,C)

  And it is not related to IupLua. I tested with:

box[key]= {numcol=2, numcol_visible=2,  numlin=0}

  An the result is the same.

  It seems it is not a valid Lua declaration. You should post at the Lua
list to get a better answer... :)

  On the other hand, this is valid:

box[key].click_cb = function(self, L,C)

  According to the Lua documentation:

The statement

     function t.a.b.c.f () *body* end

translates to

     t.a.b.c.f = function () *body* end


  So for me it was the same as above. But then, I guess it is not. It does
not work in any Lua 5.x.

  Interesting again.

  Anyway, Milind already answer it. Thanks!

Best,
Scuri


On Thu, Jul 9, 2015 at 9:45 PM, John Huttley <[email protected]>
wrote:

> Hi,
> I've been doing a bit of programming with IUP LUA under windows.
>
> And have discovered this oddness.
> ===========
> require( "iuplua" )
> require( "iupluacontrols" )
>
> box = {}
> key = "999"
>
> box[key]= iup.matrix {numcol=2, numcol_visible=2,  numlin=0}
>
>
> local box_key = box[key]    -- This works
> function box_key:click_cb(L,C)
> end
>
>
> -- The function def below doesn't like the [key], doesn't compile
> function box[key]:click_cb(L,C)
> end
>
>
> ========
>
> I'm at a loss to understand why the latter function doesn't compile.
>
> Any advice greatfully received.
>
> --John
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Iup-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to