Man page - sdl_showopenfolderdialog(3)
Packages contains this manual
Manual
SDL_ShowOpenFolderDialog
NAMEHEADER FILE
SYNOPSIS
DESCRIPTION
FUNCTION PARAMETERS
THREAD SAFETY
AVAILABILITY
SEE ALSO
NAME
SDL_ShowOpenFolderDialog - Displays a dialog that lets the user select a folder on their filesystem.
HEADER FILE
Defined in SDL3/SDL_dialog.h
SYNOPSIS
#include "SDL3/SDL.h"
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, bool allow_many);
DESCRIPTION
This is an asynchronous function; it will return immediately, and the result will be passed to the callback.
The callback will be invoked with a null-terminated list of files the user chose. The list will be empty if the user canceled the dialog, and it will be NULL if an error occurred.
Note that the callback may be called from a different thread than the one the function was invoked on.
Depending on the platform, the user may be allowed to input paths that donβt yet exist.
On Linux,
dialogs may require XDG Portals, which requires DBus, which
requires an event-handling loop. Apps that do not use SDL to
handle events should add a call to
SDL_PumpEvents
in their main loop.
FUNCTION PARAMETERS
callback
a function pointer to be invoked when the user selects a file and accepts, or cancels the dialog, or an error occurs.
userdata
an optional pointer to pass extra data to the callback when it will be invoked.
|
window |
the window that the dialog should be modal for, may be NULL. Not all platforms support this option. |
default_location
the default folder or file to start the dialog at, may be NULL. Not all platforms support this option.
allow_many
if non-zero, the user will be allowed to select multiple entries. Not all platforms support this option.
THREAD SAFETY
This function should be called only from the main thread. The callback may be invoked from the same thread or from a different one, depending on the OSβs constraints.
AVAILABILITY
This function is available since SDL 3.2.0.
SEE ALSO
β’ (3), SDL_DialogFileCallback (3type), β’ (3), SDL_ShowOpenFileDialog (3), β’ (3), SDL_ShowSaveFileDialog (3), β’ (3), SDL_ShowFileDialogWithProperties (3)