diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-31 21:02:02 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-31 21:02:02 (GMT) |
| commit | 355c43723fd7aa5c412649924c1aa9238657b8ca (patch) | |
| tree | 6860645c9f9dc5e224471af5170c578a2d13435e /src/cat/LuaWindow.cpp | |
| parent | e8628274ada57b6a526e7cdb261875ac95f05db5 (diff) | |
| download | powder-355c43723fd7aa5c412649924c1aa9238657b8ca.zip powder-355c43723fd7aa5c412649924c1aa9238657b8ca.tar.gz | |
More interface API
Diffstat (limited to 'src/cat/LuaWindow.cpp')
| -rw-r--r-- | src/cat/LuaWindow.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cat/LuaWindow.cpp b/src/cat/LuaWindow.cpp index f14d0b9..e0a5298 100644 --- a/src/cat/LuaWindow.cpp +++ b/src/cat/LuaWindow.cpp @@ -8,7 +8,9 @@ extern "C" #include <iostream> #include "LuaWindow.h" #include "LuaButton.h" +#include "LuaLabel.h" #include "interface/Button.h" +#include "interface/Label.h" #include "interface/Window.h" const char LuaWindow::className[] = "Window"; @@ -91,8 +93,10 @@ int LuaWindow::addComponent(lua_State * l) { void * luaComponent = NULL; ui::Component * component = NULL; - if(luaComponent = luaL_checkudata(l, 1, "Button")) + if(luaComponent = Luna<LuaButton>::tryGet(l, 1)) component = Luna<LuaButton>::get(luaComponent)->GetComponent(); + else if(luaComponent = Luna<LuaLabel>::tryGet(l, 1)) + component = Luna<LuaLabel>::get(luaComponent)->GetComponent(); else luaL_typerror(l, 1, "Component"); if(component) |
