Simon Chan wrote:
> I am writing a simple program that changes the label when a button is
> clicked, but I am getting the following error when the button is
> clicked:
> 
> Gtk-CRITICAL **: gtk_label_set_text: assertion `GTK_IS_LABEL (label)' failed
> 
> I am only able to change the label when the label is declared as
> "private static Label label"
> Help is appreciated, thank you very much!!

Hi,
you must store your Main instance in a variable, otherwise it gets freed
before "Gtk.main()".

BTW, you can connect a single function directly to a signal without
wrapping it into a lambda expression:

  button.clicked.connect (changeLabel);


Best Regards,

Frederik
_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to