mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(ui): implement CSimpleEditBox_SetText
This commit is contained in:
parent
e64f267bee
commit
73001e7e45
@ -129,7 +129,18 @@ int32_t CSimpleEditBox_Insert(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleEditBox_SetText(lua_State* L) {
|
int32_t CSimpleEditBox_SetText(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
auto type = CSimpleEditBox::GetObjectType();
|
||||||
|
auto editBox = static_cast<CSimpleEditBox*>(FrameScript_GetObjectThis(L, type));
|
||||||
|
|
||||||
|
if (!lua_isstring(L, 2)) {
|
||||||
|
return luaL_error(L, "Usage: %s:SetText(\"text\")", editBox->GetDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO lua_tainted
|
||||||
|
auto text = lua_tostring(L, 2);
|
||||||
|
editBox->SetText(text, nullptr);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleEditBox_GetText(lua_State* L) {
|
int32_t CSimpleEditBox_GetText(lua_State* L) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user