resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / DialogConfirm.vala
1 static DialogConfirm  _DialogConfirm;
2
3 public class DialogConfirm : Object 
4 {
5     public Gtk.MessageDialog el;
6     private DialogConfirm  _this;
7
8     public static DialogConfirm singleton()
9     {
10         if (_DialogConfirm == null) {
11             _DialogConfirm= new DialogConfirm();
12         }
13         return _DialogConfirm;
14     }
15
16         // my vars (def)
17
18     // ctor 
19     public DialogConfirm()
20     {
21         _this = this;
22         this.el = new Gtk.MessageDialog( null, Gtk.DialogFlags.MODAL, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, "Tests", null );
23
24         // my vars (dec)
25
26         // set gobject values
27         this.el.title = "Please Confirm d";
28         this.el.name = "DialogConfirm";
29         this.el.modal = true;
30         this.el.use_markup = true;
31
32         // listeners 
33         this.el.delete_event.connect( (event) => {
34             this.el.response(Gtk.ResponseType.CANCEL);
35             this.el.hide();
36             return true;
37             
38         });
39     }
40
41     // user defined functions 
42     public   int show (string title, string msg) {
43          //if (!this.el) { this.init(); } 
44          //this.success = success;
45          this.el.title = title;
46         this.el.text =  msg;
47         this.el.show_all();
48         var ret =   this.el.run();
49         //print("ret got %d", ret);
50         this.el.hide();
51         return ret;
52         
53     
54     }
55 }