Re: [Vala] Can not connect Gtk.Action to a function
- From: Nor Jaidi Tuah <norjaidi tuah ubd edu bn>
- To: vala-list gnome org
- Subject: Re: [Vala] Can not connect Gtk.Action to a function
- Date: Thu, 04 Feb 2010 14:36:13 +0800
var actiongroup = new Gtk.ActionGroup("MainActions");
Gtk.MenuItem menuitem = new Gtk.MenuItem.with_mnemonic("_Actions");
Gtk.Menu actionmenu = new Gtk.Menu();
Gtk.Action test = new Gtk.Action ("Test", "Test", null, null);
actiongroup.add_action (test);
test.activate.connect ((source) => {
sample_func();
});
Gtk.MenuItem testitem = (Gtk.MenuItem) factoraction.create_menu_item();
actionmenu.append(testitem);
menuitem.set_submenu(actionmenu);
menubar.append (menuitem);
....
public void sample_func()
{
debug ("sample function executed");
}
Could this be the elusive bug?
Gtk.MenuItem testitem = (Gtk.MenuItem) factoraction.create_menu_item();
i.e. you visual doesn't correspond to your internal.
hand
Nor Jaidi Tuah
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]