[widget] Print error on unkown widget type

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-05-25 14:08:46 +02:00
parent c822a9ccf1
commit ab62a78884
1 changed files with 1 additions and 3 deletions

View File

@ -176,16 +176,14 @@ luaA_widget_new(lua_State *L)
type = luaA_getopt_string(L, 1, "type", NULL);
/* \todo use type to call the widget_constructor_t and set ->tell*/
if((wc = name_func_lookup(type, WidgetList)))
w = wc(align);
else
return 0;
luaL_error(L, "unkown widget type: %s", type);
/* Set visible by default. */
w->isvisible = true;
/* \todo check that the name is unique */
w->name = luaA_name_init(L);
return luaA_widget_userdata_new(w);