在我的代码中,我有这样的行:
Builder builder = new Builder();
builder.AddFromFile(gladefile);
FileChooserDialog dialog =
(FileChooserDialog) builder.GetObject("dialog");
FileFilter[] filters = new FileFilter[2];
filters[0] = new FileFilter();
filters[0].Name = "Some filter";
filters[0].AddPattern("*.someextension");
filters[1] = new FileFilter();
filters[1].Name = "All files";
filters[1].AddPattern("*");
foreach (FileFilter filter in filters)
dialog.AddFilter(filter);
dialog.Filter = filters[0];
dialog.SetFilename(defaultFile);
有没有办法在 Glade 中设置这些过滤器,而不是手动设置?