mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
[widget] Print error on unkown widget type
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
c822a9ccf1
commit
ab62a78884
1 changed files with 1 additions and 3 deletions
4
widget.c
4
widget.c
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue