示例#1
0
static int l_uiWindowTitle( lua_State* L )
{
	char* s = uiWindowTitle( (uiWindow*) check_object( L, 1, uiWindowSignature ) );
	lua_pushstring( L, s );
	uiFreeText( s );
	return 1;
}
示例#2
0
文件: main.c 项目: janet-lang/janetui
static Janet janet_ui_window_title(int32_t argc, Janet *argv) {
    janet_arity(argc, 1, 2);
    uiWindow *window = janet_getuitype(argv, 0, &window_td);
    if (argc == 2) {
        const uint8_t *newTitle = janet_getstring(argv, 1);
        uiWindowSetTitle(window, (const char *)newTitle);
        return argv[0];
    }
    return janet_cstringv(uiWindowTitle(window));
}