[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Could do with some guidance on Lua interfacing please
- From: Geoff Smith <spammealot1@...>
- Date: Sun, 31 Jan 2016 14:51:40 +0000
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 !
From: firstname.lastname@example.org <email@example.com> on behalf of Duncan Cross <firstname.lastname@example.org>
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 <email@example.com> 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.)