Re: [Vala] Generated code, GTK signals and prefixes.



On Wed, Feb 10, 2010 at 23:36:23 -0200, Carlos Eduardo da Fonseca wrote:
Hello everyone,

is there any way to connect signals from a GtkBuilder XML without writing
the "Vala generated function name"?

For example:

namespace MyNamespace {
class MyClass {
static void my_handler(Widget widget) { ... }
 }
 }

In my GtkBuilder XML I'll have to define:

<signal name="clicked" handler="my_namespace_my_class_my_handler"/>

Isn't any way to avoid this?

Why, yes. Write your own binder for use with Gtk.Builder.connect_signals_full
that understands Vala names and can mangle the names for you. It can also use
custom marshallers if you want to avoid having to specify the
[CCode(instance_pos = -1)] for non-static methods.

-- 
                                                 Jan 'Bulb' Hudec <bulb ucw cz>



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