diff dwt/widgets/Button.d @ 66:bb2217c09e61

Fixed signal blocking/unblocking: The right closure is chosen by the user_data value. In the D port the CallbackData struct is used to encapsulate also an instance pointer to the Display. When selecting the closure, the pointer of the CallbackData must be given instead of the integer constant. To make porting easier, value getter are created. They are called 'ud'+NAME.
author Frank Benoit <benoit@tionex.de>
date Sun, 13 Jan 2008 23:50:55 +0100
parents 6537a52fde85
children 295b29fc7d13
line wrap: on
line diff
--- a/dwt/widgets/Button.d	Sat Jan 12 15:38:16 2008 +0100
+++ b/dwt/widgets/Button.d	Sun Jan 13 23:50:55 2008 +0100
@@ -711,10 +711,10 @@
 public void setSelection (bool selected) {
     checkWidget();
     if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) is 0) return;
-    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, cast(void*)CLICKED);
+    OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCLICKED);
     OS.gtk_toggle_button_set_active (cast(GtkToggleButton*)handle, selected);
     if ((style & SWT.RADIO) !is 0) OS.gtk_toggle_button_set_active (cast(GtkToggleButton*)groupHandle, !selected);
-    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, cast(void*)CLICKED);
+    OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCLICKED);
 }
 
 /**