[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Could do with some guidance on Lua interfacing please
- From: Geoff Smith <spammealot1@...>
- Date: Sun, 31 Jan 2016 14:51:40 +0000
Hi Duncan
Thanks for the reply, yes sorry that was more of a typo on my part
I really meant Ideally frm1:Show() -- Syntax sugar for frm1.Show(frm1)
For the actual problem, I am hazy but I think I probably need to construct a lua table in C# and return that Lua table. It would contain maybe 2 elements
a) the C# ref to the form instance, and b) a lua function Show(). which then calls back into C# to do the actual showing of the windows form.
Or alternatively is there a way to implement this using metatables and metamehods ? hmmmm not sure.
I wish the documentation for LuaInterface was better, and with more examples of how to use it !
Geoff
________________________________________
From: lua-l-bounces@lists.lua.org <lua-l-bounces@lists.lua.org> on behalf of Duncan Cross <duncan.cross@gmail.com>
Sent: 31 January 2016 14:25
To: Lua mailing list
Subject: Re: Could do with some guidance on Lua interfacing please
On Sun, Jan 31, 2016 at 1:05 PM, Geoff Smith <spammealot1@live.co.uk> wrote:
> The obvious thing I dont like about that is the horrible syntax, I want to
> be able to call something like frm1.show() in Lua.
>
> How would I go about rejigging that syntax construct ?
In Lua syntax, the way to call an instance method is
objectname:methodname(...) with a colon instead of a dot. (This is
general advice, rather than specific to LuaInterface.)
-Duncan