On 6/24/06, JimD <[EMAIL PROTECTED]> wrote:
> Michael Hutchinson wrote:
> > There's also the ReorderChild method, or you you could use some other
> > widget (e.g. a label) as a placeholder.
>
> What method would I use to replace the label widget with some other widget?

There's no method to do it directly, but it's not hard to write one,
e.g. (untested)

static void ReplaceWidget (Gtk.Widget old, Gtk.Widget new, Gtk.Box box)
{
    int pos = System.Array.IndexOf (box.Children, old);
    if (pos < 0)
        return;

    bool expand, fill;
    uint packing;
    Gtk.PackType packType;
    box.QueryChildPacking (old, out expand, out fill, out padding, out
packType);

    box.Remove (old);
    box.PackEnd (new);
    box.SetChildPacking (new, expand, fill, padding, packType);
    box.ReorderChild (new, pos);

    new.Show ();
    old.Destroy ();
}

Alternatively you could use a Bin-derived container (i.e. contains
only one object) as the placeholder, but that would be unnecessary
overhead.
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to