2 valac --pkg gio-2.0 --pkg posix --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0 --pkg libwnck-3.0 \
3 /tmp/DialogTemplateSelect.vala -o /tmp/DialogTemplateSelect
8 static int main (string[] args) {
10 new Xcls_DialogTemplateSelect();
11 DialogTemplateSelect.show_all();
18 public static Xcls_DialogTemplateSelect DialogTemplateSelect;
20 public class Xcls_DialogTemplateSelect
23 private static Xcls_DialogTemplateSelect _this;
25 public Xcls_combo combo;
26 public Xcls_cellrenderer cellrenderer;
27 public Xcls_model model;
32 public Xcls_DialogTemplateSelect()
34 this.el = new Gtk.Dialog();
36 DialogTemplateSelect = this;
41 this.el.default_height = 200;
42 this.el.default_width = 400;
44 var child_0 = new Xcls_VBox2();
45 this.el.get_content_area().add ( child_0.el );
46 var child_1 = new Xcls_Button8();
47 this.el.add_action_widget ( child_1.el , 0 );
50 this.el.delete_event.connect( (self, event) =>{
56 // userdefined functions
58 // skip listeners - not pipe
60 // skip default_height - already used
62 // skip default_width - already used
64 // skip xtype - not pipe
65 public JsRender.Node? show (Palete.Palete pal, JsRender.Node node) {
68 var opts = pal.listTemplates(node);
69 if (opts.length() < 1) {
73 //opts.unshift({ path: '' , name :'Just add Element' });
74 _this.model.loadData(opts);
75 _this.combo.el.set_active(0);
80 var ix = _this.combo.el.get_active();
86 return pal.loadTemplate(opts.nth_data(ix));
90 // skip |modal - already used
92 // skip |xns - no return type
94 // skip items - not pipe
98 // skip xvala_cls - not pipe
100 // skip xvala_xcls - not pipe
102 // skip xvala_id - not pipe
103 public class Xcls_VBox2
112 this.el = new Gtk.VBox( true, 0 );
116 // set gobject values
117 var child_0 = new Xcls_HBox3();
118 this.el.pack_start ( child_0.el , false,false,0 );
121 // userdefined functions
123 // skip xtype - not pipe
125 // skip |pack - already used
127 // skip |xns - no return type
129 // skip items - not pipe
131 // skip xvala_cls - not pipe
133 // skip xvala_xcls - not pipe
135 // skip xvala_id - not pipe
137 public class Xcls_HBox3
146 this.el = new Gtk.HBox( true, 0 );
150 // set gobject values
151 var child_0 = new Xcls_Label4();
152 this.el.pack_start ( child_0.el , false,false );
153 var child_1 = new Xcls_combo();
154 this.el.add ( child_1.el );
159 // userdefined functions
161 // skip pack - not pipe
163 // skip xtype - not pipe
165 // skip |xns - no return type
167 // skip listeners - not pipe
169 // skip items - not pipe
171 // skip xvala_cls - not pipe
173 // skip xvala_xcls - not pipe
175 // skip xvala_id - not pipe
177 public class Xcls_Label4
186 this.el = new Gtk.Label( "Select Template : " );
190 // set gobject values
193 // userdefined functions
195 // skip label - already used
197 // skip pack - not pipe
199 // skip xtype - not pipe
201 // skip |xns - no return type
203 // skip xvala_cls - not pipe
205 // skip xvala_xcls - not pipe
207 // skip xvala_id - not pipe
209 public class Xcls_combo
211 public Gtk.ComboBox el;
218 this.el = new Gtk.ComboBox();
223 // set gobject values
224 var child_0 = new Xcls_cellrenderer();
225 this.el.pack_start ( child_0.el , true );
226 var child_1 = new Xcls_model();
227 this.el.set_model ( child_1.el );
230 // userdefined functions
232 // skip id - not pipe
234 // skip pack - not pipe
236 // skip xtype - not pipe
238 // skip |init - already used
240 // skip |xns - no return type
242 // skip items - not pipe
244 // skip xvala_cls - not pipe
246 // skip xvala_xcls - not pipe
248 // skip xvala_id - not pipe
250 public class Xcls_cellrenderer
252 public Gtk.CellRendererText el;
257 public Xcls_cellrenderer()
259 this.el = new Gtk.CellRendererText();
260 _this.cellrenderer = this;
264 // set gobject values
267 // userdefined functions
269 // skip id - not pipe
271 // skip pack - not pipe
273 // skip xtype - not pipe
275 // skip |xns - no return type
277 // skip xvala_cls - not pipe
279 // skip xvala_xcls - not pipe
281 // skip xvala_id - not pipe
283 public class Xcls_model
285 public Gtk.ListStore el;
292 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
297 // set gobject values
300 // userdefined functions
302 // skip id - not pipe
304 // skip n_columns - already used
306 // skip pack - not pipe
308 // skip xtype - not pipe
310 // skip |columns - already used
311 public void loadData (GLib.List<string> data) {
319 el.set_value(iter, 0, "");
320 el.set_value(iter, 1, "Just add Element");
322 for (var i = 0; i < data.length();i++) {
326 var str = data.nth_data(i);
327 var fn = Path.get_basename (str);
328 fn.replace(".json", "");
330 el.set_value(iter, 0, fn);
331 el.set_value(iter, 1, str);
338 // skip |xns - no return type
340 // skip xvala_cls - not pipe
342 // skip xvala_xcls - not pipe
344 // skip xvala_id - not pipe
346 public class Xcls_Button8
348 public Gtk.Button el;
353 public Xcls_Button8()
355 this.el = new Gtk.Button();
359 // set gobject values
360 this.el.label = "OK";
363 // userdefined functions
365 // skip label - already used
367 // skip pack - not pipe
369 // skip xtype - not pipe
371 // skip |xns - no return type
373 // skip xvala_cls - not pipe
375 // skip xvala_xcls - not pipe
377 // skip xvala_id - not pipe