Re: [Vala] Closure problem in Gtk.AccelGroup



On Fri, Jun 11, 2010 at 11:21:14AM -0700, jezra lickter wrote:
Hello,
basing my work on the documentation found at
http://valadoc.org/gtk+-2.0/Gtk.AccelGroup.connect.html
I am trying to connect an acclegroup to a Closure
code:
AccelGroup accel = new AccelGroup();
accel.connect('q', Gdk.ModifierType.CONTROL_MASK,
      Gtk.AccelFlags.VISIBLE,
      ()=> { 
              stdout.printf("quit"); 
      } );

When I compile my application, I get the following error in regards to
the closure
"error: lambda expression not allowed in this context"

Can someone please tell me what I am doing wrong or point me to a
working example of using AccelGroup.connect()?

Good point. You can't. There's no binding for Closure/CClosure currently.

I'd suggest to add "new Closure.for_callback (owned CCallback callback);"
Defining a new CCallback like Callback but with has_target=true (apparently
inconsistent in glib). The ClosureNotify can be gracefully casted to
DestroyNotify. Evan?

-- 
http://www.debian.org - The Universal Operating System

Attachment: signature.asc
Description: Digital signature



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