Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <lluis@xamarin.com>2013-11-01 01:34:43 +0400
committerLluis Sanchez <lluis@xamarin.com>2013-11-01 01:34:43 +0400
commitdfc729dd856d1cceff7853a2648468d4f68d044e (patch)
tree75dcd4e678d1242d969a0398aa14cfc03e3af8a5 /Xwt.Gtk
parent1392fb54b08abe4e07b9cc14c4c93fb7e8ef777c (diff)
[GTK] Fix CloseRequested event for Dialogs
Diffstat (limited to 'Xwt.Gtk')
-rw-r--r--Xwt.Gtk/Xwt.GtkBackend/DialogBackend.cs11
1 files changed, 10 insertions, 1 deletions
diff --git a/Xwt.Gtk/Xwt.GtkBackend/DialogBackend.cs b/Xwt.Gtk/Xwt.GtkBackend/DialogBackend.cs
index e84c47c9..ce3033d7 100644
--- a/Xwt.Gtk/Xwt.GtkBackend/DialogBackend.cs
+++ b/Xwt.Gtk/Xwt.GtkBackend/DialogBackend.cs
@@ -126,7 +126,16 @@ namespace Xwt.GtkBackend
// GTK adds a border to the root widget, for some unknown reason
((Gtk.Container)Window.Child).BorderWidth = 0;
var p = (WindowFrameBackend) parent;
- MessageService.RunCustomDialog (Window, p != null ? p.Window : null);
+
+ bool keepRunning = false;
+ do {
+ var res = MessageService.RunCustomDialog (Window, p != null ? p.Window : null);
+ if (res == (int) Gtk.ResponseType.DeleteEvent) {
+ ApplicationContext.InvokeUserCode(delegate {
+ keepRunning = EventSink.OnCloseRequested ();
+ });
+ }
+ } while (keepRunning);
}
public void EndLoop ()