How create new GtkBin widget



Hello,

I would like create a new GtkBin widget, but this simple code (writen in
Vala) don't work (label don't show) :

using Gtk;

public class Gtk.StackContainer : Gtk.Bin
{
}

public class Test
{
  public static int main (string[] args)
  {
    Gtk.init (ref args);
    Gtk.Window win = new Gtk.Window (Gtk.WindowType.TOPLEVEL);
    win.destroy += Gtk.main_quit;
    Gtk.StackContainer stack = new Gtk.StackContainer ();
    win.add (stack);
    stack.add (new Gtk.Label ("Label"));
    win.show_all ();
    Gtk.main ();
    return 0;
  }
}

Can you help me?

Regards,
-- 
Nicolas Joseph

Responsable de la rubrique GTK+ de developpez.com

http://nicolasj.developpez.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]