[Gtk-sharp-list] Bring to front

Mario Carrión mario.carrion at gmail.com
Sun Mar 19 18:36:42 EST 2006


Recently I've been writing a container using Gtk.Layout with the idea of
using, in the MonoUML project, as diagramming canvas, the point is when
a second widget is added "covers" others widgets that are same position,
however I'm wondering is there any way to bring the covered widget to
front?

In the following sample, imagine I want to bring b1 to front.

///
using Gtk;
using System;

public class Sample
{
        public static void Main ()
        {
                Application.Init ();
                Window window = new Window ("");
                Layout layout = new Layout (new Adjustment
(IntPtr.Zero),
                                        new Adjustment (IntPtr.Zero));
                Button b1 = new Button ("1");
                Button b2 = new Button ("2");
                layout.Put (b1, 10, 20);
                layout.Put (b2, 15, 15);
                ScrolledWindow scrolled = new ScrolledWindow ();
                scrolled.AddWithViewport (layout);
                window.Add (scrolled);
                window.ShowAll ();
                Application.Run ();
        }
}
///

Cheers
-- 
Mario Carrión <mario.carrion at gmail.com>



More information about the Gtk-sharp-list mailing list