1 // 2 // TestCheckButton.cs 3 // 4 // Author: Duncan Mak (duncan@ximian.com) 5 // 6 // Copyright (C) 2002, Duncan Mak, Ximian Inc. 7 // 8 9 using System; 10 11 using Gtk; 12 13 namespace WidgetViewer { 14 public class TestCheckButton 15 { 16 static Window window = null; 17 static CheckButton checked_button = null; 18 Create()19 public static Gtk.Window Create () 20 { 21 window = new Window ("GtkCheckButton"); 22 window.SetDefaultSize (200, 100); 23 24 VBox box1 = new VBox (false, 0); 25 window.Add (box1); 26 27 VBox box2 = new VBox (false, 10); 28 box2.BorderWidth = 10; 29 box1.PackStart (box2, true, true, 0); 30 31 checked_button = new CheckButton ("_button1"); 32 box2.PackStart (checked_button, true, true, 0); 33 34 checked_button = new CheckButton ("button2"); 35 box2.PackStart (checked_button, true, true, 0); 36 37 checked_button = new CheckButton ("button3"); 38 box2.PackStart (checked_button, true, true, 0); 39 40 checked_button = new CheckButton ("Inconsistent"); 41 checked_button.Inconsistent = true; 42 box2.PackStart (checked_button, true, true, 0); 43 44 HSeparator separator = new HSeparator (); 45 46 box1.PackStart (separator, false, false, 0); 47 48 box2 = new VBox (false, 10); 49 box2.BorderWidth = 10; 50 box1.PackStart (box2, false, false, 0); 51 52 Button button = new Button (Stock.Close); 53 button.Clicked += new EventHandler (OnCloseClicked); 54 button.CanDefault = true; 55 56 box2.PackStart (button, true, true, 0); 57 button.GrabDefault (); 58 return window; 59 } 60 OnCloseClicked(object o, EventArgs args)61 static void OnCloseClicked (object o, EventArgs args) 62 { 63 window.Destroy (); 64 } 65 } 66 } 67 68 69