Re: [Vala] signal cascade blocking in Gtk+
- From: Mikael Hermansson <mike tielie gmail com>
- To: Alessandro Pellizzari <alex amiran it>
- Cc: Vala ML <vala-list gnome org>
- Subject: Re: [Vala] signal cascade blocking in Gtk+
- Date: Sat, 05 Jan 2008 15:57:35 +0100
The user_data will always be filled with "self" (the Object instance).
By this I mean Vala will always pass Object instance as last parameter
(user_data) to all C callbacks. (Atleast callbacks in Gtk/Glib)
Dont forget to add [InstanceLast] on those functions to get rid Critical
warning in runtime.
A tip is to take a look at the C source created by Vala to see how vala
really handles this internally :-)
/
Mikael
On Sat, 2008-01-05 at 12:39 +0100, Alessandro Pellizzari wrote:
On sab, 2008-01-05 at 10:53 +0100, Andrea Del Signore wrote:
you have to use the delete_event like this:
private bool nascondi(Gtk.Widget w, Gdk.Event event)
{
this.hide();
return false;
}
I think that when you tried to use it, you forgot to change the
"nascondi" function signature according to the docs ;)
You are right, I forgot it. :)
Yeah! It works!!
Thank you very much! :)
But the compiler gives no warning, and the error at runtime is quite
cryptic. :/
BTW, I cannot find the docs regarding Gtk in Vala, apart from the
examples in homepage.
C callbacks have 3 arguments: widget, event, data. But I don't know if
the data parameter can be used in vala and how it must be declared (it's
a gpointer)
Should I look Mono Gtk# docs?
I have never coded in C#, only in Python+PyGtk.
Bye.
_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]