TestDocument.TestWindow.AddChild C# (CSharp) Method

AddChild() public method

public AddChild ( ) : bool
return bool
        public bool AddChild()
        {
            if (box == null) {
                box = new Gtk.HBox ();
                Add (box);
            }
            if (box.Children.Length == 0) {
                if (button1 == null)
                    button1 = new Gtk.Button ("button1");
                box.Add (button1);
                return true;
            } else if (box.Children.Length == 1) {
                if (button2 == null)
                    button2 = new Gtk.Button ("button2");
                box.Add (button2);
                return true;
            } else
                return false;
        }

Usage Example

Beispiel #1
0
        public TestMain()
        {
            TestWindowAccessibleFactory.Init ();
            window = new TestWindow ("At-spi-sharp test application");
            window.AddChild ();
            window.SetDefaultSize (600, 400);
            window.DeleteEvent += new DeleteEventHandler (WindowDelete);

            window.ShowAll ();
        }