[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Overwrite a built in Lua function with an application specific version
- From: "RJP Computing" <rjpcomputing@...>
- Date: Wed, 13 Jun 2007 08:59:59 -0400
On 6/13/07, Alex Queiroz <firstname.lastname@example.org> wrote:
On 6/13/07, RJP Computing <email@example.com> wrote:
> I am new to Lua so I apologize if this question is easy. I have a GUI
> application that does not have a terminal and I wanted script writers to be
> able to see there print() statements in the GUI. Now I am sure I could catch
> the standard in and out, but that is a real pain. I was hoping I could
> overwrite the print function in Lua to call my applications version of it
> and then display it in my user interface. Can this be done?
_G.print = <insert your function here>
Thanks for the quick response.
I was hoping to do this in C through the C API. Can I get an example of that?