2026-06-18 19:40:23 -05:00
|
|
|
#include <izo/Dialogs.hpp>
|
2026-06-18 00:49:32 -05:00
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
int main() {
|
2026-06-18 19:40:23 -05:00
|
|
|
izo::DialogOptions options;
|
2026-06-18 00:49:32 -05:00
|
|
|
options.title = "Choose an image";
|
|
|
|
|
options.filters = {
|
|
|
|
|
{"Images", {"*.png", "*.jpg", "*.jpeg"}},
|
|
|
|
|
{"All files", {"*"}},
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-18 19:40:23 -05:00
|
|
|
const auto result = izo::OpenFile(options);
|
2026-06-18 00:49:32 -05:00
|
|
|
if (result) {
|
|
|
|
|
std::cout << result.paths.front().string() << '\n';
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2026-06-18 19:40:23 -05:00
|
|
|
if (result.status == izo::DialogStatus::Error) {
|
|
|
|
|
std::cerr << result.errorMessage << '\n';
|
2026-06-18 00:49:32 -05:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|