void OpenFile(object obj, EventArgs e) { FileChooserDialog dialog = new FileChooserDialog(Catalog.GetString(Catalog.GetString("Open Stetic File")), null, FileChooserAction.Open, Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, Gtk.Stock.Open, Gtk.ResponseType.Ok); int response = dialog.Run(); if (response == (int)Gtk.ResponseType.Ok) { SteticMain.LoadProject(dialog.Filename); AddRecentFile(dialog.Filename); } dialog.Hide(); }
void BuildRecentMenu() { foreach (Gtk.Widget w in recentFilesMenu) { recentFilesMenu.Remove(w); } int n = 0; foreach (string f in recentFiles.Files) { MenuItem m = new MenuItem("_" + n + " " + Path.GetFileName(f)); string fname = f; m.Activated += delegate { SteticMain.LoadProject(fname); AddRecentFile(fname); }; recentFilesMenu.Append(m); n++; } recentFilesMenu.ShowAll(); }