build/api-examples/FileDialog.cpp¶
Complete program from the FileDialog API reference. Save it at the path shown above and use the build command in the reference page.
Source files · Download FileDialog.cpp
#include "desktop_gui.hpp"
#include <cstdio>
#include <cstring>
int main()
{
gaspardos::desktop::NativeFileAccess access;
gaspardos::desktop::FileDialog dialog(access);
dialog.begin(gaspardos::desktop::FileExplorer::OpenFile, "/AHCIDISK0");
GO64_Event event = {};
event.type = 8;
event.key = 27;
dialog.event(event, 0);
return !dialog.active() && !dialog.accepted() ? 0 : 1;
}