Re: [Vala] Is a Direct GCallback to signals possible in vala?




Sorry about my mistake, I should wrote at the end:
widget.hide_on_delete()

Tal

From: tal_hd hotmail com
To: vala-list gnome org
Date: Wed, 31 Aug 2011 17:23:30 +0300
Subject: [Vala] Is a Direct GCallback to signals possible in vala?

 
I take a look in the generated C code, and I thought, does signal handling
have to be two stages? It possible to do it on 1 stage, right?
I'll give an example that shows this behavior:
Take a look on gtk_widget_hide_on_delete method in GTK. This method
were ment to be used as direct callback to delete-event, for popup hiding
popup windows when user click something outside of this window.
I thought I'll embrace it in my Vala code, but I run into a little mess- access
to this method denied. This is because of vala behavior a.foo (...) instead
of ..._foo (a, ...) .
I "fixed" this by adding Gtk.widget_hide_on_delete to my low_binding.vapi
file. So this is how it looked:
[CCode (cheader_filename = "gtk/gtk.h", cname_prefix = "gtk_widget_hide_on_delete")]
public static bool widget_hide_on_delete (Widget widget);
 
But then I get:
error: Argument 1: Cannot convert from`Gtk.widget_hide_on_delete' to `Gtk.Widget.delete_event'
I tried to add a parameter named "Gdk.Event event" to the method above.
I get error from CC that too many arguments in this method, which were only
logical to me after I looked on the generated code. So far, the only way to use
this method is by writing another method or lambda that calls to:
Widget.hide_on_delete (widget)
Is it possible to do it by a single GCallback? I'm talking only about static
methods, because that for the others have the "self" order problem.
                                          

_______________________________________________
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]