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:// [email protected]
> 
> _______________________________________________
> Vala-list mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/vala-list

_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to