// // The Pimp The Pathetic Image Manipulation Program // Copyright (c) 2004-2008 Sam Hocevar // All Rights Reserved // // $Id$ // // This library is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it // and/or modify it under the terms of the Do What The Fuck You Want // To Public License, Version 2, as published by Sam Hocevar. See // http://sam.zoy.org/wtfpl/COPYING for more details. // using System; using Gtk; using Pipi; using ThePimp; public partial class MainWindow: Gtk.Window { public MainWindow (): base (Gtk.WindowType.Toplevel) { Build (); Title += " v" + Libpipi.getVersion(); notebook1.Add(new PictureView(new Pipi.Picture("random:1024x1024"))); //scrolledwindow1.Add(new PictureView(new Pipi.Picture("random:1024x1024"))); } protected void OnDeleteEvent (object sender, DeleteEventArgs a) { Application.Quit (); a.RetVal = true; } protected virtual void OnOpenActionActivated (object sender, System.EventArgs e) { ThePimp.OpenFile open = new ThePimp.OpenFile(); Pipi.Picture p = open.Load(); open.Destroy(); if(p != null) { Title += " image " + p.Width + "x" + p.Height; notebook1.RemovePage(0); notebook1.AppendPage(new PictureView(p), null); } } protected virtual void OnQuitActionActivated (object sender, System.EventArgs e) { Application.Quit (); } }