lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2009/7/30 Subhash_Patil <Subhash_Patil@satyam.com>:
> I am trying to bring some interactivity to my c appliaction,
>
> To begin with, I am trying to draw a rectangle which is defined in Gui.c
> from LUA in my application Application_main.c.
>
> [...]
>
> Int Lua_main( void )
> {
>             int error;
>             lua_State *L = lua_open();   /* opens Lua */
>             luaL_Reg Creg;
>
>             lua_Integer n;
>             luaL_openlibs(L);
>
>             printf("luaL_openlibs\n");
>             lua_pushcfunction(L, SCSL_Draw_Rect(L));
>             printf("lua_pushcfunction\n");
>
> /*            n = 0;
>             lua_pushinteger(L, n);*/
>             n = 100;
>             lua_pushinteger(L, n);
>             n = 100;
>             printf("lua_pushinteger\n");
>             lua_pushinteger(L, n);
>             n = 300;
>             lua_pushinteger(L, n);
>             n = 300;
>             lua_pushinteger(L, n);
>             printf("lua_call\n");
>             lua_call( L, 5, 0);
>             printf("lua_call\n");
>             lua_close(L);
>
>             return 0;
> }
>
> I get all the prints in the Lua_main function. I see all the prints on the
> console but not the rectangle.
>
> Can you help me out in this regard.
>
> Thanks in advance.

You forgot to give us the content of SCSL_Draw_Rect.

Lua is not an acronym, you shouldn't capitalize it (see
http://www.lua.org/about.html#name).

Please send emails as plain text, not html, especially when you paste code.