28#include <ROOT/RFileDialog.hxx>
33void filedialog(
int kind = 0)
39 case 1: fileName = RFileDialog::OpenFile(
"OpenFile title");
break;
40 case 2: fileName = RFileDialog::SaveAs(
"SaveAs title",
"newfile.xml");
break;
41 case 3: fileName = RFileDialog::NewFile(
"NewFile title",
"test.txt");
break;
45 printf(
"Selected file: %s\n", fileName.c_str());
49 auto dialog = std::make_shared<RFileDialog>(RFileDialog::kOpenFile,
"OpenFile dialog in async mode");
51 dialog->SetNameFilters({
"C++ files (*.cxx *.cpp *.c *.C)",
"ROOT files (*.root)",
"Image files (*.png *.jpg *.jpeg)",
"Text files (*.txt)",
"Any files (*)" });
53 dialog->SetSelectedFilter(
"ROOT files");
56 dialog->SetCallback([dialog](
const std::string &res)
mutable {
57 printf(
"Selected file: %s\n", res.c_str());
#define R__LOAD_LIBRARY(LIBRARY)