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);
93 // print("click:" + res.path.to_string());
105 public class Xcls_LeftTreeMenu : Object
108 private Xcls_WindowLeftTree _this;
114 public Xcls_LeftTreeMenu(Xcls_WindowLeftTree _owner)
116 print("Xcls_LeftTreeMenu:Ctor called\n");
120 this.el = new Gtk.Menu();
121 _this.LeftTreeMenu = this;
125 // set gobject values
126 var child_0 = new Xcls_MenuItem7(_this);
127 this.el.add ( child_0.el );
128 child_0.initListeners();
129 var child_1 = new Xcls_MenuItem8(_this);
130 this.el.add ( child_1.el );
134 // userdefined functions
136 // skip id - not pipe
138 // skip pack - not pipe
140 // skip xtype - not pipe
142 // skip |xns - no return type
144 // skip items - not pipe
146 // skip xvala_cls - not pipe
148 // skip xvala_xcls - not pipe
150 // skip xvala_id - not pipe
152 public class Xcls_MenuItem7 : Object
154 public Gtk.MenuItem el;
155 private Xcls_WindowLeftTree _this;
161 public Xcls_MenuItem7(Xcls_WindowLeftTree _owner)
166 this.el = new Gtk.MenuItem.with_label("Delete Element");
169 // set gobject values
170 //this.el.label = "Delete Element";
174 public void initListeners() {
175 print("add activate\n");
176 this.el.activate.connect( ( ) => {
184 // userdefined functions
186 // skip listeners - not pipe
188 // skip label - already used
190 // skip pack - not pipe
192 // skip xtype - not pipe
194 // skip |xns - no return type
196 // skip xvala_cls - not pipe
198 // skip xvala_xcls - not pipe
200 // skip xvala_id - not pipe
202 public class Xcls_MenuItem8 : Object
204 public Gtk.MenuItem el;
205 private Xcls_WindowLeftTree _this;
211 public Xcls_MenuItem8(Xcls_WindowLeftTree _owner)
213 this.el = new Gtk.MenuItem();
218 // set gobject values
219 this.el.label = "Save as Template";
222 this.el.activate.connect( () => {
229 // userdefined functions
231 // skip listeners - not pipe
233 // skip label - already used
235 // skip pack - not pipe
237 // skip xtype - not pipe
239 // skip |xns - no return type
241 // skip xvala_cls - not pipe
243 // skip xvala_xcls - not pipe
245 // skip xvala_id - not pipe