fix line numbering issues with vala generator - hopefully fixes completion in node...
[roobuilder] / 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, "Test" );
23
24             // my vars (dec)
25
26             // set gobject values
27             this.el.title = "Please Confirm ";
28             this.el.name = "DialogConfirm";
29             this.el.modal = true;
30             this.el.use_markup = true;
31
32             //listeners
33             this.el.close_request.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 void showIt // caller needs to connect to the  response -  to get the result.
43           
44           (string title, string msg) {
45              //if (!this.el) { this.init(); } 
46              //this.success = success;
47              this.el.title = title;
48             this.el.text =  msg;
49             this.el.show();
50            
51            
52         }
53     }