tools
[app.Builder.js] / Sample / StandardErrorDialog.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 StandardErrorDialog=new XObject({
13     xtype: Gtk.MessageDialog,
14     buttons : Gtk.ButtonsType.OK,
15     modal : true,
16     message_type : Gtk.MessageType.ERROR,
17     text : "fixme",
18     use_markup : true,
19     show : function(msg) {
20          if (!this.el) {
21                 this.init();
22             }
23             this.el.text =  msg;
24             this.el.show_all();
25     },
26     listeners : {
27         delete_event : function (self, event) {
28             this.el.hide();
29             return true;
30         },
31         response : function (self, response_id) {
32            this.el.hide();
33         }
34     }
35 });
36 StandardErrorDialog.init();
37 XObject.cache['/StandardErrorDialog'] = StandardErrorDialog;