Sample/DialogSaveTemplate.js
[app.Builder.js] / Sample / DialogSaveTemplate.js
1 Gtk = imports.gi.Gtk;
2 Gdk = imports.gi.Gdk;
3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
5 Gio = imports.gi.Gio;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
9 Vte = imports.gi.Vte;
10 console = imports.console;
11 XObject = imports.XObject.XObject;
12 DialogSaveTemplate=new XObject({
13     xtype: Gtk.Dialog,
14     listeners : {
15         delete_event : function (self, event) {
16             this.el.hide();
17             return true;
18         },
19         response : function (self, response_id) {
20             if (!response_id) {
21                  return;
22             }
23             // now we save it..
24             
25             
26         }
27     },
28     default_height : 200,
29     default_width : 400,
30     items : [
31         {
32             xtype: Gtk.HBox,
33             pack : function(p,e) {
34                                 p.el.get_content_area().add(e.el)
35                             },
36             items : [
37                 {
38                     xtype: Gtk.Label,
39                     label : "Name",
40                     pack : "add"
41                 },
42                 {
43                     xtype: Gtk.Entry,
44                     pack : "add"
45                 }
46             ]
47         },
48         {
49             xtype: Gtk.Button,
50             label : "Cancel",
51             pack : "add_action_widget,0"
52         },
53         {
54             xtype: Gtk.Button,
55             label : "OK",
56             pack : "add_action_widget,0"
57         }
58     ]
59 });
60 DialogSaveTemplate.init();
61 XObject.cache['/DialogSaveTemplate'] = DialogSaveTemplate;