2 valac --pkg gio-2.0 --pkg posix --pkg gtk+-3.0 \
3 menu.vala -o /tmp/menutest
8 static int main (string[] args) {
10 new Xcls_WindowLeftTree();
11 WindowLeftTree.show_all();
17 int main (string[] args) {
20 GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL);
27 public class Xcls_Window : Object {
30 public Xcls_Window() {
31 var w = new Gtk.Window( );
33 var b = new Gtk.Button.with_label ("Click me (0)");
35 var leftmenu = new Gtk.Menu();
37 b.button_press_event.connect( ( ev) => {
39 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
43 leftmenu.popup(null, null, null, ev.button, ev.time);
49 var child_0 = new Xcls_MenuItem7();
52 leftmenu.append ( child_0.el );
57 public class Xcls_MenuItem7 : Object
59 public Gtk.MenuItem el;
60 public Xcls_Window _this;
62 public void init(Xcls_Window _owner ) {
64 this.el = new Gtk.MenuItem.with_label("Delete Element");
66 print("add activate\n");
67 this.el.activate.connect( ( ) => {