Example #1
0
static Janet janet_ui_save_file(int32_t argc, Janet *argv) {
    janet_fixarity(argc, 1);
    uiWindow *window = janet_getuitype(argv, 0, &window_td);
    char *str = uiSaveFile(window);
    if (NULL != str) return janet_cstringv(str);
    return janet_wrap_nil();
}
Example #2
0
File: main.c Project: CUGLSF/libui
static void saveClicked(uiMenuItem *item, uiWindow *w, void *data)
{
	char *filename;

	filename = uiSaveFile(mainwin);
	if (filename == NULL) {
		uiMsgBoxError(mainwin, "No file selected", "Don't be alarmed!");
		return;
	}
	uiMsgBox(mainwin, "File selected (don't worry, it's still there)", filename);
	uiFreeText(filename);
}