Sample/RooProjectProperties.js
[app.Builder.js] / Sample / RooProjectProperties.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 RooProjectProperties=new XObject({
13     xtype: Gtk.Dialog,
14     modal : true,
15     show : function() {
16         this.el.show_all();
17     },
18     default_width : 500,
19     listeners : {
20         "delete_event":function (self, event) {
21             this.el.hide()
22             return true;
23         },
24         "response":function (self, response_id) {
25            print(response_id);
26            if (!response_id) {
27               this.el.hide();
28               return;
29            }
30            // ok pressed..
31            this.el.hide();
32         }
33     },
34     items : [
35         {
36             xtype: Gtk.VBox,
37             pack : function(p,e) {
38                         p.el.get_content_area().add(e.el);
39                         e.border_width  =5;
40                     },
41             items : [
42                 {
43                     xtype: Gtk.Table,
44                     pack : "pack_start,true,true,3",
45                     init : function() {
46                         this.el = new Gtk.Table.c_new(1,2, true);
47                         XObject.prototype.init.call(this);
48                     
49                     },
50                     items : [
51                         {
52                             xtype: Gtk.Label,
53                             pack : "attach,0,1,0,1,0,0,0,0",
54                             label : "baseURL "
55                         },
56                         {
57                             xtype: Gtk.Entry,
58                             pack : "attach,1,2,0,1,5"
59                         },
60                         {
61                             xtype: Gtk.Label,
62                             pack : "attach,0,1,1,2,0,0,1,0",
63                             label : "login:"
64                         },
65                         {
66                             xtype: Gtk.Entry,
67                             pack : "attach,1,2,1,2,5"
68                         },
69                         {
70                             xtype: Gtk.Label,
71                             pack : "attach,0,1,2,3,0,0,1,0",
72                             label : "password"
73                         },
74                         {
75                             xtype: Gtk.Entry,
76                             pack : "attach,1,2,2,3,5",
77                             visibility : false
78                         }
79                     ]
80                 }
81             ]
82         },
83         {
84             xtype: Gtk.Button,
85             pack : "add_action_widget,1",
86             label : "OK"
87         },
88         {
89             xtype: Gtk.Button,
90             pack : "add_action_widget,0",
91             label : "Cancel"
92         }
93     ]
94 });
95 RooProjectProperties.init();
96 XObject.cache['/RooProjectProperties'] = RooProjectProperties;