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



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;
                                ^^^^^^
  }
  ...
}

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




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