From 8440aeda7f9a0c5bd95a872f7db9a6688b1555ef Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Fri, 28 Jul 2006 19:13:49 +0000 Subject: [PATCH] gtk-sharp module split svn path=/trunk/gtk-sharp/; revision=63107 --- sample/PrintSample.cs | 80 ------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 sample/PrintSample.cs diff --git a/sample/PrintSample.cs b/sample/PrintSample.cs deleted file mode 100644 index 34315936c..000000000 --- a/sample/PrintSample.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using Gtk; -using Gnome; - -class PrintSample -{ - TextView tv; - - static void Main () - { - new PrintSample (); - } - - PrintSample () - { - Application.Init (); - Gtk.Window win = new Gtk.Window ("Print sample"); - win.SetDefaultSize (400, 300); - win.DeleteEvent += new DeleteEventHandler (OnWinDelete); - - VBox vbox = new VBox (false, 0); - win.Add (vbox); - - tv = new TextView (); - tv.Buffer.Text = "Hello World"; - vbox.PackStart (tv, true, true, 0); - - Button print = new Button (Gtk.Stock.Print); - print.Clicked += new EventHandler (OnPrintClicked); - vbox.PackStart (print, false, true, 0); - - win.ShowAll (); - Application.Run (); - } - - void MyPrint (Gnome.PrintContext gpc) - { - gpc.BeginPage ("demo"); - gpc.MoveTo (1, 700); - gpc.Show (tv.Buffer.Text); - gpc.ShowPage (); - } - - void OnPrintClicked (object o, EventArgs args) - { - Gnome.PrintJob pj = new Gnome.PrintJob (Gnome.PrintConfig.Default ()); - Gnome.PrintDialog dialog = new Gnome.PrintDialog (pj, "Print Test", 0); - int response = dialog.Run (); - Console.WriteLine ("response: " + response); - - if (response == (int) PrintButtons.Cancel) { - Console.WriteLine ("Canceled"); - dialog.Hide (); - dialog.Dispose (); - return; - } - - Gnome.PrintContext ctx = pj.Context; - MyPrint (ctx); - - pj.Close (); - - switch (response) { - case (int) PrintButtons.Print: - pj.Print (); - break; - case (int) PrintButtons.Preview: - new PrintJobPreview (pj, "Print Test").Show (); - break; - } - - dialog.Hide (); - dialog.Dispose (); - } - - void OnWinDelete (object o, DeleteEventArgs args) - { - Application.Quit (); - } -}