Re: [Vala] 0.7 signal syntax



On Tue, Apr 21, 2009 at 3:12 PM, Levi Bard
 <taktaktaktaktaktaktaktaktaktak gmail com> wrote:
I try replacing the line
       drawing_area.expose_event += this.on_expose;
with
       drawing_area.expose_event.connect(this.on_expose);

but this gives an error... could anyone enlighten me on what is the
correct syntax?

That is the correct syntax.
What is the error you're getting?

 valac --pkg gtk+-2.0 --pkg cairo cairo.vala
 Compilation failed: 1 error(s), 0 warning(s)
 cairo.vala:23.37-23.50: error: Argument 1: Cannot convert from
 `CairoSample.on_expose' to `Gtk.Widget.expose_event'
                drawing_area.expose_event.connect(this.on_expose);
                                                  ^^^^^^^^^^^^^^
 make: *** [cairo] Error 1


I suspect it wants the first argument of on_expose() to be a Gtk.Widget.


 On Wed, Apr 22, 2009 at 12:10 AM, William Swanson <swansontec gmail com> wrote:

The new syntax was introduced in Vala 0.7.1, not  0.7.0. Are you using
the latest point release?

 yes, "0.7.1 signal syntax" I should have said in the subject

 -- lode



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