Re: [Vala] Gtk.CheckMenuItem activate signal is useless (maybe)



On Sat, 2009-05-09 at 14:40 +0400, Харин Роман wrote:
so, its litttle code example:

class MyApp : Window {

  private Image main_img;

  public MyApp() {
    ...
    item_viewbg = new CheckMenuItem.with_label("Показывать фон");
    item_viewbg.active = true;
    item_viewbg.activate.connect(onMenuBackImage);
   ...
  }

  void onMenuBackImage(MenuItem menu) {
        main_img.visible = menu.active;
                              ^^^^^^
main_img.visible = (menu as CheckMenuItem).active;

Did you try the old signal connection syntax (using +=)?


- Yu
  }
  ...
}

MenuItem has no "active" property, but CheckMenuItem has one.
And i would like to write:

  void onMenuBackImage(CheckMenuItem menu) {
        main_img.visible = menu.active;
  }

but: Cannot convert from `MainWindow.onMenuBackImage' to
`Gtk.MenuItem.activate'

---
Харин Роман,
jabber:// harinr jabber ru

_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list




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