From c7e479dbdb17d1d70f7ed63da9e02305a372acc5 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 24 May 2010 15:27:20 +0800 Subject: [PATCH] Sample/StandardErrorDialog.js --- Sample/StandardErrorDialog.js | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Sample/StandardErrorDialog.js diff --git a/Sample/StandardErrorDialog.js b/Sample/StandardErrorDialog.js new file mode 100644 index 000000000..3088e0699 --- /dev/null +++ b/Sample/StandardErrorDialog.js @@ -0,0 +1,38 @@ +Gtk = imports.gi.Gtk; +Gdk = imports.gi.Gdk; +Pango = imports.gi.Pango; +GLib = imports.gi.GLib; +Gio = imports.gi.Gio; +GObject = imports.gi.GObject; +GtkSource = imports.gi.GtkSource; +WebKit = imports.gi.WebKit; +Vte = imports.gi.Vte; +console = imports.console; +XObject = imports.XObject.XObject; +StandardErrorDialog=new XObject({ + xtype: Gtk.MessageDialog, + buttons : Gtk.ButtonsType.OK, + modal : true, + message_type : Gtk.MessageType.ERROR, + text : "fixme", + use_markup : true, + show : function(msg) { + if (!this.el) { + this.init(); + } + this.el.text = msg; + this.el.show_all(); + }, + listeners : { + "delete_event":function (self, event) { + this.el.hide(); + return true; + }, + "response":function (self, response_id) { + this.el.hide(); + } + } +}) +;StandardErrorDialog.init(); +XObject.cache['/StandardErrorDialog'] = StandardErrorDialog; +; \ No newline at end of file -- 2.39.2