JsRender/Roo.js
[app.Builder.js] / Builder4 / DialogConfirm.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 DialogConfirm=new XObject({
13     xtype: Gtk.MessageDialog,
14     listeners : {
15         response : function (self, response_id) {
16            this.el.hide();
17              print("RESPOSE: " + response_id);
18             if (response_id == -8) { //yes!
19            print("CALL SUCCES?")
20             this.success(); //  fixme a delegate
21             }
22         }
23         /*--
24          ( response_id) =>  {
25            this.el.hide();
26             //print("RESPOSE: " + response_id);
27             if (response_id == -8) { //yes!
28                    print("CALL SUCCES?");
29               // this.success();
30             }
31         
32         
33         }
34         */,
35         delete_event : function (self, event) {
36             this.el.hide();
37             return true;
38         }
39         /*--
40         (event) => {
41             this.el.hide();
42             return true;
43         }
44         */
45     },
46     text : "Tests",
47     title : "Please Confirm d",
48     buttons : Gtk.ButtonsType.YES_NO,
49     message_type : Gtk.MessageType.QUESTION,
50     modal : true,
51     show : function(msg, success) {
52          if (!this.el) {
53                 this.init();
54             }
55          this.success = success;
56             this.el.text =  msg;
57             this.el.show_all();
58     
59     }
60     
61     /*--
62     void (string msg) {
63          //if (!this.el) { this.init(); } 
64          //this.success = success;
65         this.el.text =  msg;
66         this.el.show_all();
67     
68     }
69     
70     */,
71     show_all : function() {
72         this.show("test");
73     }
74     /*--
75     void () {
76         this.show("test");
77     }
78     */,
79     use_markup : true
80 });
81 DialogConfirm.init();
82 XObject.cache['/DialogConfirm'] = DialogConfirm;