Beispiel #1
0
static Janet janet_ui_button_text(int32_t argc, Janet *argv) {
    janet_arity(argc, 1, 2);
    uiButton *button = janet_getuitype(argv, 0, &button_td);
    if (argc == 2) {
        const uint8_t *newText = janet_getstring(argv, 1);
        uiButtonSetText(button, (const char *)newText);
        return argv[0];
    }
    return janet_cstringv(uiButtonText(button));
}
Beispiel #2
0
static int l_uiButtonText( lua_State* L )
{
	char* s = uiButtonText( (uiButton*) check_object( L, 1, uiButtonSignature ) );
	lua_pushstring( L, s );
	return 1;
}