X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=tests%2Fmenu.vala;h=8423e05d867cd24a9f0d1ad4bb678da33d9d0ab4;hb=f4090cf4a9f85803c4c70236f9b72c5c44f2180e;hp=405f5d8b8d43ca1e3102171dd13a689c915a7b6a;hpb=c87e7b8b41a96128c15991350965a5d789d9e3f3;p=app.Builder.js diff --git a/tests/menu.vala b/tests/menu.vala index 405f5d8b8..8423e05d8 100644 --- a/tests/menu.vala +++ b/tests/menu.vala @@ -18,7 +18,7 @@ int main (string[] args) { Gtk.init (ref args); GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL); - + new Xcls_Window(); Gtk.main(); return 0; @@ -39,10 +39,7 @@ public class Xcls_Window : Object { if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) { return false; } - - - //leftmenu.el.set_screen(Gdk.Screen.get_default()); - + leftmenu.popup(null, null, null, ev.button, ev.time); return true; @@ -50,29 +47,30 @@ public class Xcls_Window : Object { var child_0 = new Xcls_MenuItem7(); - child_0.init(); + child_0.ref(); + child_0.init(this); leftmenu.append ( child_0.el ); leftmenu.show_all(); w.show_all(); -} -public class Xcls_MenuItem7 : Object -{ - public Gtk.MenuItem el; - public Xcls_Window _this; + } + public class Xcls_MenuItem7 : Object + { + public Gtk.MenuItem el; + public Xcls_Window _this; - public void init(Xcls_Window _owner ) { - _this = _owner; - - this.el = new Gtk.MenuItem.with_label("Delete Element"); - print("add activate\n"); - this.el.activate.connect( ( ) => { - - print("SELECT?"); - - return ; - } ); - } + public void init(Xcls_Window _owner ) { + //_this = _owner; + this.el = new Gtk.MenuItem.with_label("Delete Element"); + this.el.ref(); + print("add activate\n"); + this.el.activate.connect( ( ) => { + + print("SELECT?"); + + return ; + } ); + } + } } -