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);
22 var a = new Xcls_WindowLeftTree();
32 public static Xcls_WindowLeftTree WindowLeftTree;
34 public class Xcls_WindowLeftTree : Object
37 private Xcls_WindowLeftTree _this;
38 public Xcls_button button;
39 public Xcls_LeftTreeMenu LeftTreeMenu;
42 public Xcls_WindowLeftTree()
44 this.el = new Gtk.Window( );
46 WindowLeftTree = this;
52 var child_0 = new Xcls_button(_this);
53 this.el.add ( child_0.el );
54 _this.LeftTreeMenu = new Xcls_LeftTreeMenu(_this);
62 // skip xvala_id - not pipe
63 public class Xcls_button : Object
66 private Xcls_WindowLeftTree _this;
69 public Xcls_button(Xcls_WindowLeftTree _owner)
71 this.el = new Gtk.Button.with_label ("Click me (0)");
78 this.el.button_press_event.connect( ( ev) => {
79 //console.log("button press?");
83 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
84 //print("click" + ev.type);
89 //_this.LeftTreeMenu.el.set_screen(Gdk.Screen.get_default());
90 //_this.LeftTreeMenu.el.show_all();
91 _this.LeftTreeMenu.el.popup(null, null, null, ev.button, ev.time);
92 // print("click:" + res.path.to_string());
104 public class Xcls_LeftTreeMenu : Object
107 private Xcls_WindowLeftTree _this;
113 public Xcls_LeftTreeMenu(Xcls_WindowLeftTree _owner)
115 print("Xcls_LeftTreeMenu:Ctor called\n");
119 this.el = new Gtk.Menu();
120 _this.LeftTreeMenu = this;
124 // set gobject values
125 var child_0 = new Xcls_MenuItem7(_this);
126 this.el.add ( child_0.el );
127 var child_1 = new Xcls_MenuItem8(_this);
128 this.el.add ( child_1.el );
131 // userdefined functions
133 // skip id - not pipe
135 // skip pack - not pipe
137 // skip xtype - not pipe
139 // skip |xns - no return type
141 // skip items - not pipe
143 // skip xvala_cls - not pipe
145 // skip xvala_xcls - not pipe
147 // skip xvala_id - not pipe
149 public class Xcls_MenuItem7 : Object
151 public Gtk.MenuItem el;
152 private Xcls_WindowLeftTree _this;
158 public Xcls_MenuItem7(Xcls_WindowLeftTree _owner)
163 this.el = new Gtk.MenuItem.with_label("Delete Element");
166 // set gobject values
167 //this.el.label = "Delete Element";
168 print("add activate\n");
172 this.el.select.connect( ( ) => {
180 // userdefined functions
182 // skip listeners - not pipe
184 // skip label - already used
186 // skip pack - not pipe
188 // skip xtype - not pipe
190 // skip |xns - no return type
192 // skip xvala_cls - not pipe
194 // skip xvala_xcls - not pipe
196 // skip xvala_id - not pipe
198 public class Xcls_MenuItem8 : Object
200 public Gtk.MenuItem el;
201 private Xcls_WindowLeftTree _this;
207 public Xcls_MenuItem8(Xcls_WindowLeftTree _owner)
209 this.el = new Gtk.MenuItem();
214 // set gobject values
215 this.el.label = "Save as Template";
218 this.el.activate.connect( () => {
225 // userdefined functions
227 // skip listeners - not pipe
229 // skip label - already used
231 // skip pack - not pipe
233 // skip xtype - not pipe
235 // skip |xns - no return type
237 // skip xvala_cls - not pipe
239 // skip xvala_xcls - not pipe
241 // skip xvala_id - not pipe