Vala: How to use Glades ActionGroup correctly

Posted by Tom on Ask Ubuntu See other posts from Ask Ubuntu or by Tom
Published on 2011-11-20T18:20:53Z Indexed on 2011/11/20 18:26 UTC
Read the original article Hit count: 274

Filed under:

Could someone give me an example how to use Glade's ActionGroup with a Gtk.Builder in a Vala-Application?

If I have an ActionGroup with an Action save, and on this action I've set the activate Signal to "on_save_clicked", should it be fine to write:

[CCode (instance_pos = -1)]
public void on_save_clicked(){
  print("I would like to save, please\n");
}

in global scope and then use builder.connect_signals(null)?

When i do this, i just get "Could not find signal handler 'on_save_clicked'" when executing the program. No compile errors.

I'm using

valac --pkg gtk+-3.0 test.vala

for compiling and glade-3.10.0

© Ask Ubuntu or respective owner

Related posts about vala