diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2012-01-11 23:03:40 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@xamarin.com> | 2012-01-11 23:06:32 +0400 |
commit | b521d65957699b475e782e2e9ca451331f2a0264 (patch) | |
tree | 1c94fd094b564796bf4b789e01b3b8849677bcfb /Xwt.Gtk/Xwt.GtkBackend | |
parent | 804b4f6fa519267ad9c38165b0f89b200b69c8b8 (diff) |
Don't fire the click event when changing the Active property.
Diffstat (limited to 'Xwt.Gtk/Xwt.GtkBackend')
-rwxr-xr-x | Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs | 10 | ||||
-rw-r--r-- | Xwt.Gtk/Xwt.GtkBackend/ToggleButtonBackend.cs | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs b/Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs index b8e3a728..caef5967 100755 --- a/Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs +++ b/Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs @@ -32,6 +32,8 @@ namespace Xwt.GtkBackend { public class ButtonBackend: WidgetBackend, IButtonBackend { + protected bool ignoreClickEvents; + public ButtonBackend () { } @@ -152,9 +154,11 @@ namespace Xwt.GtkBackend void HandleWidgetClicked (object sender, EventArgs e) { - Toolkit.Invoke (delegate { - EventSink.OnClicked (); - }); + if (!ignoreClickEvents) { + Toolkit.Invoke (delegate { + EventSink.OnClicked (); + }); + } } } } diff --git a/Xwt.Gtk/Xwt.GtkBackend/ToggleButtonBackend.cs b/Xwt.Gtk/Xwt.GtkBackend/ToggleButtonBackend.cs index 6f5fbfd0..b7394b07 100644 --- a/Xwt.Gtk/Xwt.GtkBackend/ToggleButtonBackend.cs +++ b/Xwt.Gtk/Xwt.GtkBackend/ToggleButtonBackend.cs @@ -81,7 +81,9 @@ namespace Xwt.GtkBackend return Widget.Active; } set { + ignoreClickEvents = true; Widget.Active = value; + ignoreClickEvents = false; } } |