static int l_uiLabelText( lua_State* L ) { char* s = uiLabelText( (uiLabel*) check_object( L, 1, uiLabelSignature ) ); lua_pushstring( L, s ); uiFreeText( s ); return 1; }
static Janet janet_ui_label_text(int32_t argc, Janet *argv) { janet_arity(argc, 1, 2); uiLabel *label = janet_getuitype(argv, 0, &label_td); if (argc == 2) { const uint8_t *text = janet_getstring(argv, 1); uiLabelSetText(label, (const char *)text); return argv[0]; } return janet_cstringv(uiLabelText(label)); }