resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / StandardErrorDialog.vala
1 /* -- to compile
2 valac  --pkg gio-2.0  --pkg posix  --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0  --pkg  libwnck-3.0 \
3     /tmp/StandardErrorDialog.vala  -o /tmp/StandardErrorDialog
4 */
5
6
7 /* -- to test class
8 static int main (string[] args) {
9     Gtk.init (ref args);
10     new Xcls_StandardErrorDialog();
11     StandardErrorDialog.show_all();
12      Gtk.main ();
13     return 0;
14 }
15 */
16
17
18 public static Xcls_StandardErrorDialog  StandardErrorDialog;
19
20 public class Xcls_StandardErrorDialog : Object 
21 {
22     public Gtk.MessageDialog el;
23     private Xcls_StandardErrorDialog  _this;
24
25     public static Xcls_StandardErrorDialog singleton()
26     {
27         if (StandardErrorDialog == null) {
28             StandardErrorDialog= new Xcls_StandardErrorDialog();
29         }
30         return StandardErrorDialog;
31     }
32
33         // my vars
34
35         // ctor 
36     public Xcls_StandardErrorDialog()
37     {
38         _this = this;
39         this.el = new Gtk.MessageDialog( null, Gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, "fixme" );
40
41         // my vars
42
43         // set gobject values
44         this.el.modal = true;
45         this.el.use_markup = true;
46
47         // listeners 
48         this.el.delete_event.connect(   (self, event)  => {
49             this.el.hide();
50             return true;
51             
52         } 
53          );
54         this.el.response.connect(   (self, response_id) => {
55            this.el.hide();
56         } );
57     }
58
59     // userdefined functions 
60     public void show (Gtk.Window win, string msg) {
61         
62             this.el.set_transient_for(win);
63             this.el.modal = true;
64             this.el.text =  msg;
65             this.el.show_all();
66         }
67
68     // skip |xns - no return type
69 }