dbgenerate.js
[app.Builder.js] / Builder / 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 GtkClutter = imports.gi.GtkClutter;
11 console = imports.console;
12 XObject = imports.XObject.XObject;
13 DialogConfirm=new XObject({
14     xtype: Gtk.MessageDialog,
15     show : function(msg, success) {
16          if (!this.el) {
17                 this.init();
18             }
19          this.success = success;
20             this.el.text =  msg;
21             this.el.show_all();
22     
23     },
24     buttons : Gtk.ButtonsType.YES_NO,
25     title : "Please Confirm",
26     message_type : Gtk.MessageType.QUESTION,
27     use_markup : true,
28     text : "-",
29     modal : true,
30     listeners : {
31         response : function (self, response_id) {
32            this.el.hide();
33         print("RESPOSE: " + response_id);
34             if (response_id == -8) { //yes!
35            print("CALL SUCCES?")
36               this.success();
37             }
38         },
39         delete_event : function (self, event) {
40             this.el.hide();
41             return true;
42         }
43     }
44 });
45 DialogConfirm.init();
46 XObject.cache['/DialogConfirm'] = DialogConfirm;