当我尝试显示文件选择器对话框时,它缺少操作按钮:
let dialog = FileChooserDialog::new(Some("Open File"), Some(&window), FileChooserAction::Open);
dialog.run();
我从另一个项目中找到了另一种方法:
let dialog = FileChooserDialog::new_with_buttons::<ApplicationWindow>(
Some("Open File"),
Some(&window),
FileChooserAction::Open,
&[
("_Cancel", ResponseType::Cancel),
("_Open", ResponseType::Accept),
],
);
错误信息是:
no function or associated item named `new_with_buttons` found for type `gtk::FileChooserDialog` in the current scope