author | francesco-ST <francesco.abbate@st.com> | 2011年02月28日 15:12:30 +0100 |
---|---|---|
committer | francesco-ST <francesco.abbate@st.com> | 2011年02月28日 15:12:30 +0100 |
commit | 60313bea3183efb50ca4e96a825fab1140f1f4d1 (patch) | |
tree | 383b6d7379b067a5c9eebd126a0e3a566ab140cd /agg-plot/lua-text.cpp | |
parent | 571489dca80ab4c3261b03f854a451063f275239 (diff) | |
download | gsl-shell-60313bea3183efb50ca4e96a825fab1140f1f4d1.tar.gz |
-rw-r--r-- | agg-plot/lua-text.cpp | 10 |
diff --git a/agg-plot/lua-text.cpp b/agg-plot/lua-text.cpp index 1efcbbe3..065211a7 100644 --- a/agg-plot/lua-text.cpp +++ b/agg-plot/lua-text.cpp @@ -31,10 +31,14 @@ static const struct luaL_Reg text_functions[] = { {NULL, NULL} }; -static const struct luaL_Reg text_methods[] = { +static const struct luaL_Reg text_metatable[] = { {"__gc", agg_text_free}, {"__index", agg_text_index}, {"__newindex", agg_text_newindex}, + {NULL, NULL} +}; + +static const struct luaL_Reg text_methods[] = { {"set", agg_text_set_point}, {"justif", agg_text_justif_set }, {NULL, NULL} @@ -177,7 +181,7 @@ agg_text_set_point (lua_State *L) int agg_text_index (lua_State *L) { - return mlua_index_with_properties (L, text_properties_get, false); + return mlua_index_with_properties (L, text_properties_get, text_methods, false); } int @@ -190,7 +194,7 @@ void text_register (lua_State *L) { luaL_newmetatable (L, GS_METATABLE(GS_DRAW_TEXT)); - luaL_register (L, NULL, text_methods); + luaL_register (L, NULL, text_metatable); lua_pop (L, 1); luaL_register (L, NULL, text_functions); |