選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

55 行
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. notebook1.Add(new PictureView(new Pipi.Picture("random:1024x1024")));
  25. //scrolledwindow1.Add(new PictureView(new Pipi.Picture("random:1024x1024")));
  26. }
  27. protected void OnDeleteEvent (object sender, DeleteEventArgs a)
  28. {
  29. Application.Quit ();
  30. a.RetVal = true;
  31. }
  32. protected virtual void OnOpenActionActivated (object sender, System.EventArgs e)
  33. {
  34. ThePimp.OpenFile open = new ThePimp.OpenFile();
  35. Pipi.Picture p = open.Load();
  36. open.Destroy();
  37. if(p != null)
  38. {
  39. Title += " image " + p.Width + "x" + p.Height;
  40. notebook1.RemovePage(0);
  41. notebook1.AppendPage(new PictureView(p), null);
  42. }
  43. }
  44. protected virtual void OnQuitActionActivated (object sender, System.EventArgs e)
  45. {
  46. Application.Quit ();
  47. }
  48. }