2
0

MainWindow.cs 813 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using Gtk;
  4. using UnitEditor;
  5. public partial class MainWindow: Gtk.Window
  6. {
  7. private VBox box;
  8. private Notebook nb;
  9. private UnitForm uf = null;
  10. public MainWindow () : base (Gtk.WindowType.Toplevel)
  11. {
  12. Build ();
  13. box = new VBox (false, 2);
  14. Add (box);
  15. UnitEditor.MainMenu mb = new UnitEditor.MainMenu ();
  16. this.AddAccelGroup (mb.uim.AccelGroup);
  17. box.PackStart(mb.instance, false, false, 0);
  18. nb = new Notebook ();
  19. box.PackStart (nb, false, false, 0);
  20. ShowAll ();
  21. }
  22. public void open_unit(string file_name)
  23. {
  24. uf = new UnitEditor.UnitForm (file_name);
  25. nb.AppendPage (uf.instance, new Label (file_name));
  26. ShowAll ();
  27. }
  28. protected void OnDeleteEvent (object sender, DeleteEventArgs a)
  29. {
  30. Application.Quit ();
  31. a.RetVal = true;
  32. }
  33. }