The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
file_dialog.c File Reference

idunn: a dialog to choose a file to open, or a name to save as. More...

#include "idunn_internal.h"
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/stat.h>

Macros

#define PATH_MAX_LEN   1024
#define LIST_HEIGHT   300
#define DIALOG_WIDTH   520

Functions

void idunn_file_dialog (idunn_widget_t *owner, idunn_file_mode_t mode, const char *title, const char *path, idunn_file_done_t done, void *data)
 a dialog to choose a file: the folder's items as a list, a button to the folder above, and to save, a field with the name.

Detailed Description

idunn: a dialog to choose a file to open, or a name to save as.

the folder's items are a list: folders first, then the files, by name (letter case ignored); names that start with a dot are left out. a double click or Enter opens a folder or chooses a file; the arrow button goes to the folder above. to save, the name field holds the name (a click on a file puts its name there), and a file that is there already is replaced only after a question. a name with a / in it is a path: a folder there is opened, a file chosen.

Macro Definition Documentation

◆ PATH_MAX_LEN

#define PATH_MAX_LEN   1024

◆ LIST_HEIGHT

#define LIST_HEIGHT   300

◆ DIALOG_WIDTH

#define DIALOG_WIDTH   520

Function Documentation

◆ idunn_file_dialog()

void idunn_file_dialog ( idunn_widget_t * owner,
idunn_file_mode_t mode,
const char * title,
const char * path,
idunn_file_done_t done,
void * data )

a dialog to choose a file: the folder's items as a list, a button to the folder above, and to save, a field with the name.

nothing is called when it is cancelled.

Parameters
paththe folder to start in, or (to save) the whole path of the file, whose name is then in the field.