Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

54 řádky
1.5 KiB

  1. //
  2. // The Pimp The Pathetic Image Manipulation Program
  3. // Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org>
  4. // All Rights Reserved
  5. //
  6. // $Id$
  7. //
  8. // This library is free software. It comes without any warranty, to
  9. // the extent permitted by applicable law. You can redistribute it
  10. // and/or modify it under the terms of the Do What The Fuck You Want
  11. // To Public License, Version 2, as published by Sam Hocevar. See
  12. // http://sam.zoy.org/wtfpl/COPYING for more details.
  13. //
  14. using System;
  15. using Gtk;
  16. using Pipi;
  17. using ThePimp;
  18. public partial class MainWindow: Gtk.Window
  19. {
  20. public MainWindow (): base (Gtk.WindowType.Toplevel)
  21. {
  22. Build ();
  23. Title += " v" + Libpipi.getVersion();
  24. }
  25. protected void OnDeleteEvent (object sender, DeleteEventArgs a)
  26. {
  27. Application.Quit ();
  28. a.RetVal = true;
  29. }
  30. protected virtual void OnOpenActionActivated (object sender, System.EventArgs e)
  31. {
  32. ThePimp.OpenFile open = new ThePimp.OpenFile();
  33. Pipi.Picture p = open.Load();
  34. open.Destroy();
  35. if(p != null)
  36. {
  37. while(notebook1.NPages > 0)
  38. notebook1.RemovePage(0);
  39. int n = notebook1.AppendPage(new PictureView(p),
  40. new Label(p.FileName));
  41. notebook1.Page = n;
  42. }
  43. }
  44. protected virtual void OnQuitActionActivated (object sender, System.EventArgs e)
  45. {
  46. Application.Quit ();
  47. }
  48. }