changeset 58:a5c274fa5af9

extended helloworld crashing
author Frank Benoit <benoit@tionex.de>
date Sat, 12 Jan 2008 07:02:08 +0100
parents d69eb5077fbb
children 8cec8f536af3
files dsss.conf dwt/SWT.d dwt/widgets/Button.d dwt/widgets/Canvas.d dwt/widgets/Composite.d dwt/widgets/Control.d dwt/widgets/Decorations.d dwt/widgets/Scrollable.d dwt/widgets/Shell.d dwt/widgets/Widget.d helloworld.d
diffstat 11 files changed, 254 insertions(+), 227 deletions(-) [+]
line wrap: on
line diff
--- a/dsss.conf	Sat Jan 12 01:53:16 2008 +0100
+++ b/dsss.conf	Sat Jan 12 07:02:08 2008 +0100
@@ -2,6 +2,7 @@
 type=library
 
 [helloworld.d]
+
 buildflags+=-L-lgtk-x11-2.0
 buildflags+=-L-lgdk-x11-2.0
 buildflags+=-L-latk-1.0
@@ -28,6 +29,8 @@
 buildflags+=-L-lglib-2.0
 buildflags+=-L-lcairo
 buildflags+=-I/home/frank/jive
-buildflags+=-g -gc
+#buildflags+=-g -gc
 
 
+
+[structs.d]
--- a/dwt/SWT.d	Sat Jan 12 01:53:16 2008 +0100
+++ b/dwt/SWT.d	Sat Jan 12 07:02:08 2008 +0100
@@ -3431,7 +3431,7 @@
  */
 public static char[] getMessage(char[] key) {
     // PORTING_FIXME: Implement
-    return null;
+    return "msg not found";
 	//return Compatibility.getMessage(key);
 }
 
--- a/dwt/widgets/Button.d	Sat Jan 12 01:53:16 2008 +0100
+++ b/dwt/widgets/Button.d	Sat Jan 12 07:02:08 2008 +0100
@@ -141,7 +141,7 @@
 	addListener (SWT.DefaultSelection,typedListener);
 }
 
-public Point computeSize (int wHint, int hHint, bool changed) {
+override public Point computeSize (int wHint, int hHint, bool changed) {
 	checkWidget ();
 	if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
 	if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
@@ -163,11 +163,11 @@
 	}
 	if (wHint !is SWT.DEFAULT || hHint !is SWT.DEFAULT) {
 		if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_CAN_DEFAULT) !is 0) {
-			GtkBorder* border = new GtkBorder ();
+			GtkBorder border;
             GtkBorder* buffer;
 			OS.gtk_widget_style_get1 (handle, OS.default_border.ptr, cast(int*)&buffer );
 			if (buffer !is null) {
-                border = buffer;
+                border = *buffer;
 			} else {
 				/* Use the GTK+ default value of 1 for each. */
 				border.left = border.right = border.top = border.bottom = 1;
@@ -179,7 +179,7 @@
 	return size;
 }
 
-void createHandle (int index) {
+override void createHandle (int index) {
 	state |= HANDLE;
 	if ((style & SWT.PUSH) is 0) state |= THEME_BACKGROUND;
 	int bits = SWT.ARROW | SWT.TOGGLE | SWT.CHECK | SWT.RADIO | SWT.PUSH;
@@ -247,16 +247,16 @@
 	}
 	OS.gtk_container_add (cast(GtkContainer*)fixedHandle, handle);
 
-	if ((style & SWT.ARROW) !is 0) return;
+    if ((style & SWT.ARROW) !is 0) return;
 	_setAlignment (style & (SWT.LEFT | SWT.CENTER | SWT.RIGHT));
 }
 
-void createWidget (int index) {
+override void createWidget (int index) {
 	super.createWidget (index);
 	text = "";
 }
 
-void deregister () {
+override void deregister () {
 	super.deregister ();
 	if (boxHandle !is null) display.removeWidget (boxHandle);
 	if (labelHandle !is null) display.removeWidget (labelHandle);
@@ -316,7 +316,7 @@
 	return image;
 }
 
-char[] getNameText () {
+override char[] getNameText () {
 	return getText ();
 }
 
@@ -410,7 +410,7 @@
 	return result;
 }
 
-void hookEvents () {
+override void hookEvents () {
 	super.hookEvents();
 	OS.g_signal_connect_closure (handle, OS.clicked.ptr, display.closures [CLICKED], false);
 	if (labelHandle !is null) {
@@ -418,12 +418,12 @@
 	}
 }
 
-bool isDescribedByLabel () {
+override bool isDescribedByLabel () {
 	return false;
 }
 
 alias Control.mnemonicHit mnemonicHit;
-bool mnemonicHit (char key) {
+override bool mnemonicHit (char key) {
 	if (labelHandle is null) return false;
 	bool result = super.mnemonicHit (labelHandle, key);
 	if (result) setFocus ();
@@ -431,12 +431,12 @@
 }
 
 alias Control.mnemonicMatch mnemonicMatch;
-bool mnemonicMatch (char key) {
+override bool mnemonicMatch (char key) {
 	if (labelHandle is null) return false;
 	return mnemonicMatch (labelHandle, key);
 }
 
-void register () {
+override void register () {
 	super.register ();
 	if (boxHandle !is null) display.addWidget (boxHandle, this);
 	if (labelHandle !is null) display.addWidget (labelHandle, this);
@@ -444,12 +444,12 @@
 	if (arrowHandle !is null) display.addWidget (arrowHandle, this);
 }
 
-void releaseHandle () {
+override void releaseHandle () {
 	super.releaseHandle ();
 	boxHandle = imageHandle = labelHandle = arrowHandle = null;
 }
 
-void releaseWidget () {
+override void releaseWidget () {
 	super.releaseWidget ();
 	if (groupHandle !is null) OS.g_object_unref (groupHandle);
 	groupHandle = null;
@@ -484,7 +484,7 @@
 	eventTable.unhook (SWT.DefaultSelection,listener);
 }
 
-void resizeHandle (int width, int height) {
+override void resizeHandle (int width, int height) {
 	super.resizeHandle (width, height);
 	/*
 	* Feature in GTK, GtkCheckButton and GtkRadioButton allocate
@@ -612,13 +612,13 @@
 	if (imageHandle !is null) setBackgroundColor(imageHandle, color);
 }
 
-void setFontDescription (PangoFontDescription* font) {
+override void setFontDescription (PangoFontDescription* font) {
 	super.setFontDescription (font);
 	if (labelHandle !is null) OS.gtk_widget_modify_font (labelHandle, font);
 	if (imageHandle !is null) OS.gtk_widget_modify_font (imageHandle, font);
 }
 
-bool setRadioSelection (bool value) {
+override bool setRadioSelection (bool value) {
 	if ((style & SWT.RADIO) is 0) return false;
 	if (getSelection () !is value) {
 		setSelection (value);
@@ -676,7 +676,7 @@
 	_setAlignment (style);
 }
 
-void setOrientation () {
+override void setOrientation () {
 	super.setOrientation ();
 	if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
 		if (labelHandle !is null) OS.gtk_widget_set_direction (labelHandle, OS.GTK_TEXT_DIR_RTL);
@@ -759,7 +759,7 @@
 	_setAlignment (style);
 }
 
-void showWidget () {
+override void showWidget () {
 	super.showWidget ();
 	if (boxHandle !is null) OS.gtk_widget_show (boxHandle);
 	if (labelHandle !is null) OS.gtk_widget_show (labelHandle);
--- a/dwt/widgets/Canvas.d	Sat Jan 12 01:53:16 2008 +0100
+++ b/dwt/widgets/Canvas.d	Sat Jan 12 07:02:08 2008 +0100
@@ -127,7 +127,7 @@
 	return caret;
 }
 
-Point getIMCaretPos () {
+override Point getIMCaretPos () {
 	if (caret is null) return super.getIMCaretPos ();
 	return new Point (caret.x, caret.y);
 }
@@ -153,14 +153,14 @@
 	return result;
 }
 
-void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) {
+override void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) {
 	bool isFocus = caret !is null && caret.isFocusCaret ();
 	if (isFocus) caret.killFocus ();
 	super.redrawWidget (x, y, width, height, redrawAll, all, trim);
 	if (isFocus) caret.setFocus ();
 }
 
-void releaseChildren (bool destroy) {
+override void releaseChildren (bool destroy) {
 	if (caret !is null) {
 		caret.release (false);
 		caret = null;
@@ -276,7 +276,7 @@
 	if (isFocus) caret.setFocus ();
 }
 
-int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
 	bool isFocus = caret !is null && caret.isFocusCaret ();
 	if (isFocus) caret.killFocus ();
 	int result = super.setBounds (x, y, width, height, move, resize);
@@ -318,7 +318,7 @@
 	}
 }
 
-public void setFont (Font font) {
+override public void setFont (Font font) {
 	checkWidget();
 	if (caret !is null) caret.setFont (font);
 	super.setFont (font);
--- a/dwt/widgets/Composite.d	Sat Jan 12 01:53:16 2008 +0100
+++ b/dwt/widgets/Composite.d	Sat Jan 12 07:02:08 2008 +0100
@@ -29,6 +29,8 @@
 import dwt.internal.gtk.OS;
 import dwt.graphics.Rectangle;
 
+import tango.io.Stdout;
+
 /**
  * Instances of this class are controls which are capable
  * of containing other controls.
@@ -198,23 +200,23 @@
 	}
 }
 
-void checkBuffered () {
+override void checkBuffered () {
 	if ((style & SWT.DOUBLE_BUFFERED) is 0 && (style & SWT.NO_BACKGROUND) !is 0) {
 		return;
 	}
 	super.checkBuffered();
 }
 
-protected void checkSubclass () {
+override protected void checkSubclass () {
 	/* Do nothing - Subclassing is allowed */
 }
 
-GtkStyle* childStyle () {
+override GtkStyle* childStyle () {
 	if (scrolledHandle !is null) return null;
 	return super.childStyle ();
 }
 
-public Point computeSize (int wHint, int hHint, bool changed) {
+override public Point computeSize (int wHint, int hHint, bool changed) {
 	checkWidget ();
 	if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0;
 	if (hHint !is SWT.DEFAULT && hHint < 0) hHint = 0;
@@ -238,7 +240,7 @@
 	return new Point (trim.width, trim.height);
 }
 
-Control [] computeTabList () {
+override Control [] computeTabList () {
 	Control result [] = super.computeTabList ();
 	if (result.length is 0) return result;
 	Control [] list = tabList !is null ? _getTabList () : _getChildren ();
@@ -255,7 +257,7 @@
 	return result;
 }
 
-void createHandle (int index) {
+override void createHandle (int index) {
 	state |= HANDLE | CANVAS;
 	bool scrolled = (style & (SWT.H_SCROLL | SWT.V_SCROLL)) !is 0;
 	if (!scrolled) state |= THEME_BACKGROUND;
@@ -330,7 +332,7 @@
 	}
 }
 
-void deregister () {
+override void deregister () {
 	super.deregister ();
 	if (socketHandle !is null) display.removeWidget (cast(GtkWidget*)socketHandle);
 }
@@ -393,7 +395,7 @@
 	}
 }
 
-void enableWidget (bool enabled) {
+override void enableWidget (bool enabled) {
 	if ((state & CANVAS) !is 0) return;
 	super.enableWidget (enabled);
 }
@@ -402,7 +404,7 @@
 	return layoutCount > 0 ? this : parent.findDeferredControl ();
 }
 
-Menu [] findMenus (Control control) {
+override Menu [] findMenus (Control control) {
 	if (control is this) return new Menu [0];
 	Menu result [] = super.findMenus (control);
 	Control [] children = _getChildren ();
@@ -419,7 +421,7 @@
 	return result;
 }
 
-void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
+override void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
 	super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
 	Control [] children = _getChildren ();
 	for (int i=0; i<children.length; i++) {
@@ -428,7 +430,7 @@
 }
 
 alias Scrollable.fixStyle fixStyle;
-void fixStyle () {
+override void fixStyle () {
 	super.fixStyle ();
 	if (scrolledHandle is null) fixStyle (handle);
 	Control[] children = _getChildren ();
@@ -459,6 +461,8 @@
 }
 
 void fixZOrder () {
+        Stdout.formatln( "{}: parent.fixZOrder gtk_container_get_children {:x}", __LINE__, parentingHandle() );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) );
 	if ((state & CANVAS) !is 0) return;
 	auto parentHandle = parentingHandle ();
 	auto parentWindow = OS.GTK_WIDGET_WINDOW (cast(GtkWidget*)parentHandle);
@@ -479,14 +483,16 @@
 		}
 		OS.g_list_free (windowList);
 	}
+        Stdout.formatln( "{}: parent.fixZOrder gtk_container_get_children {:x}", __LINE__, parentingHandle() );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) );
 }
 
-GtkWidget* focusHandle () {
+override GtkWidget* focusHandle () {
 	if (socketHandle !is null) return socketHandle;
 	return super.focusHandle ();
 }
 
-bool forceFocus (GtkWidget* focusHandle) {
+override bool forceFocus (GtkWidget* focusHandle) {
 	if (socketHandle !is null) OS.GTK_WIDGET_SET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
 	bool result = super.forceFocus (focusHandle);
 	if (socketHandle !is null) OS.GTK_WIDGET_UNSET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
@@ -554,7 +560,7 @@
 	return count;
 }
 
-public Rectangle getClientArea () {
+override public Rectangle getClientArea () {
 	checkWidget();
 	if ((state & CANVAS) !is 0) {
 		if ((state & ZERO_WIDTH) !is 0 && (state & ZERO_HEIGHT) !is 0) {
@@ -757,7 +763,7 @@
 	return (style & SWT.BORDER) !is 0;
 }
 
-void hookEvents () {
+override void hookEvents () {
 	super.hookEvents ();
 	if ((state & CANVAS) !is 0) {
 		OS.gtk_widget_add_events (handle, OS.GDK_POINTER_MOTION_HINT_MASK);
@@ -771,7 +777,7 @@
 	return hooks (SWT.KeyDown) || hooks (SWT.KeyUp);
 }
 
-GtkIMContext* imHandle () {
+override GtkIMContext* imHandle () {
 	return imHandle_;
 }
 
@@ -798,7 +804,7 @@
 	return findDeferredControl () !is null;
 }
 
-bool isTabGroup() {
+override bool isTabGroup() {
 	if ((state & CANVAS) !is 0) return true;
 	return super.isTabGroup();
 }
@@ -976,7 +982,7 @@
 	}
 }
 
-void markLayout (bool changed, bool all) {
+override void markLayout (bool changed, bool all) {
 	if (layout_ !is null) {
 		state |= LAYOUT_NEEDED;
 		if (changed) state |= LAYOUT_CHANGED;
@@ -989,19 +995,21 @@
 	}
 }
 
+alias Scrollable.moveAbove moveAbove;
 void moveAbove (GtkWidget* child, GtkWidget* sibling) {
 	if (child is sibling) return;
 	auto parentHandle = parentingHandle ();
 	auto fixed = cast(GtkFixed*)parentHandle;
-	auto children = fixed.children;
+	GList* children = fixed.children;
 	if (children is null) return;
-	GList* data;
+	void* data;
 	GtkWidget* widget;
-	GList* childData, childLink, siblingLink;
+	void* childData;
+    GList* childLink, siblingLink;
     GList* temp = children;
 	while (temp !is null) {
-		data = temp;
-		widget = cast(GtkWidget*) data;
+		data = temp.data;
+		widget = *cast(GtkWidget**) data;
 		if (child is widget) {
 			childLink = temp;
 			childData = data;
@@ -1026,6 +1034,7 @@
 	parentHandle = cast(GtkWidget*)fixed;
 }
 
+alias Scrollable.moveBelow moveBelow;
 void moveBelow (GtkWidget* child, GtkWidget* sibling) {
 	if (child is sibling) return;
 	auto parentHandle = parentingHandle ();
@@ -1034,36 +1043,54 @@
 		return;
 	}
 	auto fixed = cast(GtkFixed*)parentHandle;
-	auto children = fixed.children;
+	GList* children = fixed.children;
 	if (children is null) return;
-	GList* data;
+	void* data;
 	GtkWidget* widget;
-	GList* childData, childLink, siblingLink, temp = children;
+	void* childData;
+    GList* childLink, siblingLink, temp = children;
+    Stdout.formatln( "{}: before loop child={} sibling={}", __LINE__, child, sibling );
+            Stdout.formatln( "{}: parent.moveBelow gtk_container_get_children {:x}", __LINE__, parentingHandle() );
+            Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) );
 	while (temp !is null) {
-        data = temp;
+        Stdout.formatln( "{}: loop start {}->{}", __LINE__, temp, cast(void*)temp.data );
+        data = (*temp).data;
         widget = cast(GtkWidget*) data;
 		if (child is widget) {
+            Stdout.formatln( "{}: child is widget", __LINE__ );
 			childLink = temp;
 			childData = data;
 		} else if (sibling is widget) {
+            Stdout.formatln( "{}: sibling is widget", __LINE__ );
 			siblingLink = temp;
 		}
 		if (childData !is null && (sibling is null || siblingLink !is null)) break;
-		temp = temp.next;
+		temp = OS.g_list_next(temp);
+        Stdout.formatln( "{}: loop end", __LINE__ );
 	}
+    Stdout.formatln( "{}: after loop childLink={}", __LINE__, childLink );
 	children = OS.g_list_remove_link (children, childLink);
-	if (siblingLink is null || siblingLink.next is null) {
+	if (siblingLink is null || OS.g_list_next(siblingLink) is null) {
 		OS.g_list_free_1 (childLink);
+            Stdout.formatln( "{}: parent.moveBelow gtk_container_get_children {:x}", __LINE__, parentingHandle() );
+            Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) );
+            Stdout.formatln( " {} {}", children, childData );
 		children = OS.g_list_append (children, childData);
+            Stdout.formatln( "{}: parent.moveBelow gtk_container_get_children {:x}", __LINE__, parentingHandle() );
+            Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) );
 	} else {
-		temp = siblingLink.next;
-		childLink.next = temp;
-		temp.prev = childLink;
-		childLink.prev = siblingLink;
-		siblingLink.next =  childLink;
+        Stdout.formatln( "{}: parent.moveBelow gtk_container_get_children {:x}", __LINE__, parentingHandle() );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) );
+		temp = OS.g_list_next( siblingLink );
+        OS.g_list_set_next (childLink, temp);
+        OS.g_list_set_previous (temp, childLink);
+        OS.g_list_set_previous (childLink, siblingLink);
+        OS.g_list_set_next (siblingLink, childLink);
 	}
 	fixed.children = children;
     parentHandle = cast(GtkWidget*)fixed;
+        Stdout.formatln( "{}: parent.moveBelow gtk_container_get_children {:x}", __LINE__, parentingHandle() );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) );
 }
 
 Point minimumSize (int wHint, int hHint, bool changed) {
@@ -1082,7 +1109,7 @@
 	return fixedHandle !is null ? fixedHandle : handle;
 }
 
-void redrawChildren () {
+override void redrawChildren () {
 	super.redrawChildren ();
 	Control [] children = _getChildren ();
 	for (int i = 0; i < children.length; i++) {
@@ -1094,12 +1121,12 @@
 	}
 }
 
-void register () {
+override void register () {
 	super.register ();
 	if (socketHandle !is null) display.addWidget (socketHandle, this);
 }
 
-void releaseChildren (bool destroy) {
+override void releaseChildren (bool destroy) {
 	Control [] children = _getChildren ();
 	for (int i=0; i<children.length; i++) {
 		Control child = children [i];
@@ -1110,13 +1137,13 @@
 	super.releaseChildren (destroy);
 }
 
-void releaseHandle () {
+override void releaseHandle () {
 	super.releaseHandle ();
 	socketHandle = null;
     embeddedHandle = 0;
 }
 
-void releaseWidget () {
+override void releaseWidget () {
 	super.releaseWidget ();
 	if (imHandle_ !is null) OS.g_object_unref (imHandle_);
 	imHandle_ = null;
@@ -1128,7 +1155,7 @@
 	fixTabList (control);
 }
 
-void resizeHandle (int width, int height) {
+override void resizeHandle (int width, int height) {
 	super.resizeHandle (width, height);
 	if (socketHandle !is null) OS.gtk_widget_set_size_request (socketHandle, width, height);
 }
@@ -1159,7 +1186,8 @@
 	}
 }
 
-int setBounds (int x, int y, int width, int height, bool move, bool resize) {
+alias Scrollable.setBounds setBounds;
+override int setBounds (int x, int y, int width, int height, bool move, bool resize) {
 	int result = super.setBounds (x, y, width, height, move, resize);
 	if ((result & RESIZED) !is 0 && layout_ !is null) {
 		markLayout (false, false);
@@ -1168,7 +1196,7 @@
 	return result;
 }
 
-public bool setFocus () {
+override public bool setFocus () {
 	checkWidget();
 	Control [] children = _getChildren ();
 	for (int i=0; i<children.length; i++) {
@@ -1228,7 +1256,7 @@
 	}
 }
 
-bool setScrollBarVisible (ScrollBar bar, bool visible) {
+override bool setScrollBarVisible (ScrollBar bar, bool visible) {
 	bool changed = super.setScrollBarVisible (bar, visible);
 	if (changed && layout_ !is null) {
 		markLayout (false, false);
@@ -1237,7 +1265,7 @@
 	return changed;
 }
 
-bool setTabGroupFocus (bool next) {
+override bool setTabGroupFocus (bool next) {
 	if (isTabItem ()) return setTabItemFocus (next);
 	bool takeFocus = (style & SWT.NO_FOCUS) is 0;
 	if ((state & CANVAS) !is 0) takeFocus = hooksKeys ();
@@ -1251,7 +1279,7 @@
 	return false;
 }
 
-bool setTabItemFocus (bool next) {
+override bool setTabItemFocus (bool next) {
 	if (!super.setTabItemFocus (next)) return false;
 	if (socketHandle !is null) {
 		int direction = next ? OS.GTK_DIR_TAB_FORWARD : OS.GTK_DIR_TAB_BACKWARD;
@@ -1293,7 +1321,7 @@
 	this.tabList = tabList;
 }
 
-void showWidget () {
+override void showWidget () {
 	super.showWidget ();
 	if (socketHandle !is null) {
 		OS.gtk_widget_show (socketHandle);
@@ -1302,7 +1330,7 @@
 	if (scrolledHandle is null) fixStyle (handle);
 }
 
-bool translateMnemonic (Event event, Control control) {
+override bool translateMnemonic (Event event, Control control) {
 	if (super.translateMnemonic (event, control)) return true;
 	if (control !is null) {
 		Control [] children = _getChildren ();
@@ -1314,7 +1342,7 @@
 	return false;
 }
 
-int traversalCode(int key, GdkEventKey* event) {
+override int traversalCode(int key, GdkEventKey* event) {
 	if ((state & CANVAS) !is 0) {
 		if ((style & SWT.NO_FOCUS) !is 0) return 0;
 		if (hooksKeys ()) return 0;
@@ -1322,7 +1350,7 @@
 	return super.traversalCode (key, event);
 }
 
-bool translateTraversal (GdkEventKey* keyEvent) {
+override bool translateTraversal (GdkEventKey* keyEvent) {
 	if (socketHandle !is null) return false;
 	return super.translateTraversal (keyEvent);
 }
--- a/dwt/widgets/Control.d	Sat Jan 12 01:53:16 2008 +0100
+++ b/dwt/widgets/Control.d	Sat Jan 12 07:02:08 2008 +0100
@@ -52,7 +52,6 @@
 import dwt.accessibility.Accessible;
 
 import Math = tango.math.Math;
-import tango.stdc.string;
 import tango.stdc.stringz;
 import tango.core.Thread;
 import tango.io.Stdout;
@@ -131,7 +130,7 @@
 	return display.getSystemFont ().handle;
 }
 
-void deregister () {
+override void deregister () {
 	super.deregister ();
 	if (fixedHandle !is null) display.removeWidget (fixedHandle);
 	auto imHandle = imHandle ();
@@ -179,7 +178,7 @@
 	OS.GTK_WIDGET_UNSET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
 }
 
-void fixStyle () {
+public void fixStyle () {
 	if (fixedHandle !is null) fixStyle (fixedHandle);
 }
 
@@ -198,9 +197,9 @@
 	if ((state & BACKGROUND) !is 0) return;
 	auto childStyle = parent.childStyle ();
 	if (childStyle !is null) {
-		GdkColor* color = new GdkColor();
-		OS.gtk_style_get_bg (childStyle, 0, color);
-		OS.gtk_widget_modify_bg (handle, 0, color);
+		GdkColor color;
+		OS.gtk_style_get_bg (childStyle, 0, &color);
+		OS.gtk_widget_modify_bg (handle, 0, &color);
 	}
 }
 
@@ -216,7 +215,7 @@
 	return this is display.getFocusControl();
 }
 
-void hookEvents () {
+override void hookEvents () {
 	/* Connect the keyboard signals */
 	auto focusHandle = focusHandle ();
 	int focusMask = OS.GDK_KEY_PRESS_MASK | OS.GDK_KEY_RELEASE_MASK | OS.GDK_FOCUS_CHANGE_MASK;
@@ -290,7 +289,7 @@
 	OS.g_signal_connect_closure_by_id (topHandle, display.signalIds [MAP], 0, display.closures [MAP], true);
 }
 
-int /*long*/ hoverProc (int /*long*/ widget) {
+override int /*long*/ hoverProc (GtkWidget* widget) {
 	int x, y;
     int mask;
 	OS.gdk_window_get_pointer (null, &x, &y, &mask);
@@ -299,7 +298,7 @@
 	return 0;
 }
 
-GtkWidget* topHandle() {
+override GtkWidget* topHandle() {
 	if (fixedHandle !is null) return fixedHandle;
 	return super.topHandle ();
 }
@@ -314,7 +313,7 @@
 	return paintHandle;
 }
 
-GdkWindow* paintWindow () {
+override GdkWindow* paintWindow () {
 	auto paintHandle = paintHandle ();
 	OS.gtk_widget_realize (paintHandle);
 	return OS.GTK_WIDGET_WINDOW (paintHandle);
@@ -417,7 +416,7 @@
 	return parent.childStyle ();
 }
 
-void createWidget (int index) {
+override void createWidget (int index) {
 	state |= DRAG_DETECT;
 	checkOrientation (parent);
 	super.createWidget (index);
@@ -475,16 +474,16 @@
 Point computeNativeSize (GtkWidget* h, int wHint, int hHint, bool changed) {
 	int width = wHint, height = hHint;
 	if (wHint is SWT.DEFAULT && hHint is SWT.DEFAULT) {
-		GtkRequisition* requisition = new GtkRequisition ();
-		gtk_widget_size_request (h, requisition);
+		GtkRequisition requisition;
+		gtk_widget_size_request (h, &requisition);
 		width = OS.GTK_WIDGET_REQUISITION_WIDTH (h);
 		height = OS.GTK_WIDGET_REQUISITION_HEIGHT (h);
 	} else if (wHint is SWT.DEFAULT || hHint is SWT.DEFAULT) {
 		int reqWidth, reqHeight;
 		OS.gtk_widget_get_size_request (h, &reqWidth, &reqHeight);
 		OS.gtk_widget_set_size_request (h, wHint, hHint);
-		GtkRequisition* requisition = new GtkRequisition ();
-		gtk_widget_size_request (h, requisition);
+		GtkRequisition requisition;
+		gtk_widget_size_request (h, &requisition);
 		OS.gtk_widget_set_size_request (h, reqWidth, reqHeight);
 		width = wHint is SWT.DEFAULT ? requisition.width : wHint;
 		height = hHint is SWT.DEFAULT ? requisition.height : hHint;
@@ -499,14 +498,14 @@
 	* must be preceded by a call to gtk_widget_size_request().
 	*/
 	auto topHandle = topHandle ();
-	GtkRequisition* requisition = new GtkRequisition ();
-	gtk_widget_size_request (topHandle, requisition);
-	GtkAllocation* allocation = new GtkAllocation ();
+	GtkRequisition requisition;
+	gtk_widget_size_request (topHandle, &requisition);
+	GtkAllocation allocation;
 	allocation.x = OS.GTK_WIDGET_X (topHandle);
 	allocation.y = OS.GTK_WIDGET_Y (topHandle);
 	allocation.width = OS.GTK_WIDGET_WIDTH (topHandle);
 	allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle);
-	OS.gtk_widget_size_allocate (topHandle, allocation);
+	OS.gtk_widget_size_allocate (topHandle, &allocation);
 }
 
 /**
@@ -674,9 +673,9 @@
 		* all calls to gtk_widget_size_allocate() must be preceded by
 		* a call to gtk_widget_size_request().
 		*/
-		GtkRequisition* requisition = new GtkRequisition ();
-		gtk_widget_size_request (topHandle, requisition);
-		GtkAllocation* allocation = new GtkAllocation ();
+		GtkRequisition requisition;
+		gtk_widget_size_request (topHandle, &requisition);
+		GtkAllocation allocation;
 		if (move) {
 			allocation.x = x;
 			allocation.y = y;
@@ -691,7 +690,7 @@
 			allocation.width = OS.GTK_WIDGET_WIDTH (topHandle);
 			allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle);
 		}
-		OS.gtk_widget_size_allocate (topHandle, allocation);
+		OS.gtk_widget_size_allocate (topHandle, &allocation);
 	}
 	/*
 	* Bug in GTK.  Widgets cannot be sized smaller than 1x1.
@@ -841,6 +840,8 @@
 	auto parentHandle = parent.parentingHandle ();
 
     Stdout.formatln( "setRelations {:x}", cast(uint)parentHandle );
+        Stdout.formatln( "showWidget gtk_container_get_children {:x}", parentHandle );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentHandle) );
 	auto list = OS.gtk_container_get_children (cast(GtkContainer*)parentHandle);
 	if (list is null) return;
 	int count = OS.g_list_length (list);
@@ -1839,7 +1840,7 @@
 	return sendDragEvent (button, stateMask, x, y, true);
 }
 
-bool dragDetect (int x, int y, bool filter, bool [] consume) {
+bool dragDetect (int x, int y, bool filter, bool* consume) {
 	bool quit = false, dragging = false;
 	while (!quit) {
 		GdkEvent* eventPtr;
@@ -1848,13 +1849,12 @@
 			if (eventPtr !is null) {
 				break;
 			} else {
-				try {Thread.sleep(50);} catch (Exception ex) {}
+				try {Thread.sleep(0.050);} catch (Exception ex) {}
 			}
 		}
 		switch (cast(int)OS.GDK_EVENT_TYPE (eventPtr)) {
 			case OS.GDK_MOTION_NOTIFY: {
-				GdkEventMotion* gdkMotionEvent = new GdkEventMotion ();
-				memmove (gdkMotionEvent, eventPtr, GdkEventMotion.sizeof);
+				GdkEventMotion* gdkMotionEvent = cast(GdkEventMotion*)eventPtr;
 				if ((gdkMotionEvent.state & OS.GDK_BUTTON1_MASK) !is 0) {
 					if (OS.gtk_drag_check_threshold (handle, x, y, cast(int) gdkMotionEvent.x, cast(int) gdkMotionEvent.y)) {
 						dragging = true;
@@ -1869,8 +1869,7 @@
 			}
 			case OS.GDK_KEY_PRESS:
 			case OS.GDK_KEY_RELEASE: {
-				GdkEventKey* gdkEvent = new GdkEventKey ();
-				memmove (gdkEvent, eventPtr, GdkEventKey.sizeof);
+				GdkEventKey* gdkEvent = cast(GdkEventKey*)eventPtr;
 				if (gdkEvent.keyval is OS.GDK_Escape) quit = true;
 				break;
 			}
@@ -1913,7 +1912,7 @@
 	oldDecorations.fixDecorations (newDecorations, this, menus);
 }
 
-int /*long*/ fixedMapProc (GtkWidget* widget) {
+override int /*long*/ fixedMapProc (GtkWidget* widget) {
 	OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED);
 	auto widgetList = OS.gtk_container_get_children (cast(GtkContainer*)widget);
 	if (widgetList !is null) {
@@ -2211,8 +2210,8 @@
 	auto screen = OS.gdk_screen_get_default ();
 	if (screen !is null) {
 		int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, paintWindow ());
-		GdkRectangle* dest = new GdkRectangle ();
-		OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, dest);
+		GdkRectangle dest;
+		OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, &dest);
 		monitor = new dwt.widgets.Monitor.Monitor ();
 		monitor.handle = monitorNumber;
 		monitor.x = dest.x;
@@ -2333,9 +2332,7 @@
 	return (state & HIDDEN) is 0;
 }
 
-override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) {
-	GdkEventButton* gdkEvent = new GdkEventButton ();
-	memmove (gdkEvent, event, GdkEventButton.sizeof);
+override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
 	if (gdkEvent.type is OS.GDK_3BUTTON_PRESS) return 0;
 	/*
 	* When a shell is created with SWT.ON_TOP and SWT.NO_FOCUS,
@@ -2360,10 +2357,10 @@
 		bool dragging = false;
 		if ((state & DRAG_DETECT) !is 0 && hooks (SWT.DragDetect)) {
 			if (gdkEvent.button is 1) {
-				bool [] consume = new bool [1];
-				if (dragDetect (cast(int) gdkEvent.x, cast(int) gdkEvent.y, true, consume)) {
+				bool consume = false;
+				if (dragDetect (cast(int) gdkEvent.x, cast(int) gdkEvent.y, true, &consume)) {
 					dragging = true;
-					if (consume [0]) result = 1;
+					if (consume ) result = 1;
 				}
 				if (isDisposed ()) return 1;
 			}
@@ -2397,9 +2394,7 @@
 	return result;
 }
 
-override int /*long*/ gtk_button_release_event (GtkWidget* widget, GdkEventButton* event) {
-	GdkEventButton* gdkEvent = new GdkEventButton ();
-	memmove (gdkEvent, event, GdkEventButton.sizeof);
+override int /*long*/ gtk_button_release_event (GtkWidget* widget, GdkEventButton* gdkEvent) {
 	/*
 	* Feature in GTK.  When button 4, 5, 6, or 7 is released, GTK
 	* does not deliver a corresponding GTK event.  Button 6 and 7
@@ -2424,10 +2419,8 @@
 	return 0;
 }
 
-override int /*long*/ gtk_enter_notify_event (GtkWidget*  widget, GdkEventCrossing* event) {
+override int /*long*/ gtk_enter_notify_event (GtkWidget*  widget, GdkEventCrossing* gdkEvent) {
 	if (display.currentControl is this) return 0;
-	GdkEventCrossing* gdkEvent = new GdkEventCrossing ();
-	memmove (gdkEvent, event, GdkEventCrossing.sizeof);
 	if (gdkEvent.mode !is OS.GDK_CROSSING_NORMAL && gdkEvent.mode !is OS.GDK_CROSSING_UNGRAB) return 0;
 	if ((gdkEvent.state & (OS.GDK_BUTTON1_MASK | OS.GDK_BUTTON2_MASK | OS.GDK_BUTTON3_MASK)) !is 0) return 0;
 	if (display.currentControl !is null && !display.currentControl.isDisposed ()) {
@@ -2442,9 +2435,7 @@
 }
 
 override int /*long*/ gtk_event_after (GtkWidget*  widget, GdkEvent* gdkEvent) {
-	GdkEvent* event = new GdkEvent ();
-	memmove (event, gdkEvent, GdkEvent.sizeof);
-	switch (cast(int)event.type) {
+	switch (cast(int)gdkEvent.type) {
 		case OS.GDK_BUTTON_PRESS: {
 			if (widget !is eventHandle ()) break;
 			/*
@@ -2453,8 +2444,7 @@
 			* such as GtkTreeView to select items before a menu is shown.
 			*/
 			if ((state & MENU) is 0) {
-				GdkEventButton* gdkEventButton = new GdkEventButton ();
-				memmove (gdkEventButton, gdkEvent, GdkEventButton.sizeof);
+				GdkEventButton* gdkEventButton = cast(GdkEventButton*)gdkEvent;
 				if (gdkEventButton.button is 3) {
 					showMenu (cast(int) gdkEventButton.x_root, cast(int) gdkEventButton.y_root);
 				}
@@ -2463,8 +2453,7 @@
 		}
 		case OS.GDK_FOCUS_CHANGE: {
 			if (widget !is focusHandle ()) break;
-			GdkEventFocus* gdkEventFocus = new GdkEventFocus ();
-			memmove (gdkEventFocus, gdkEvent, GdkEventFocus.sizeof);
+			GdkEventFocus* gdkEventFocus = cast(GdkEventFocus*)gdkEvent;
 
 			/*
 			 * Feature in GTK. The GTK combo box popup under some window managers
@@ -2498,11 +2487,9 @@
 	return 0;
 }
 
-override int /*long*/ gtk_expose_event (GtkWidget*  widget, GdkEventExpose* eventPtr) {
+override int /*long*/ gtk_expose_event (GtkWidget*  widget, GdkEventExpose* gdkEvent) {
 	if ((state & OBSCURED) !is 0) return 0;
 	if (!hooks (SWT.Paint) && !filters (SWT.Paint)) return 0;
-	GdkEventExpose* gdkEvent = new GdkEventExpose ();
-	memmove(gdkEvent, eventPtr, GdkEventExpose.sizeof);
 	Event event = new Event ();
 	event.count = gdkEvent.count;
 	event.x = gdkEvent.area.x;
@@ -2555,23 +2542,21 @@
 	return 0;
 }
 
-override int /*long*/ gtk_key_press_event (GtkWidget*  widget, GdkEventKey* event) {
+override int /*long*/ gtk_key_press_event (GtkWidget*  widget, GdkEventKey* gdkEvent) {
 	if (!hasFocus ()) return 0;
-	GdkEventKey* gdkEvent = new GdkEventKey ();
-	memmove (gdkEvent, event, GdkEventKey.sizeof);
 
 	if (translateMnemonic (gdkEvent.keyval, gdkEvent)) return 1;
 	// widget could be disposed at this point
 	if (isDisposed ()) return 0;
 
-	if (filterKey (gdkEvent.keyval, event)) return 1;
+	if (filterKey (gdkEvent.keyval, gdkEvent)) return 1;
 	// widget could be disposed at this point
 	if (isDisposed ()) return 0;
 
 	if (translateTraversal (gdkEvent)) return 1;
 	// widget could be disposed at this point
 	if (isDisposed ()) return 0;
-	return super.gtk_key_press_event (widget, event);
+	return super.gtk_key_press_event (widget, gdkEvent);
 }
 
 override int /*long*/ gtk_key_release_event (GtkWidget*  widget, GdkEventKey* event) {
@@ -2583,13 +2568,11 @@
 	return super.gtk_key_release_event (widget, event);
 }
 
-override int /*long*/ gtk_leave_notify_event (GtkWidget* widget, GdkEventCrossing* event) {
+override int /*long*/ gtk_leave_notify_event (GtkWidget* widget, GdkEventCrossing* gdkEvent) {
 	if (display.currentControl !is this) return 0;
 	display.removeMouseHoverTimeout (handle);
 	int result = 0;
 	if (sendLeaveNotify () || display.getCursorControl () is null) {
-		GdkEventCrossing* gdkEvent = new GdkEventCrossing ();
-		memmove (gdkEvent, event, GdkEventCrossing.sizeof);
 		if (gdkEvent.mode !is OS.GDK_CROSSING_NORMAL && gdkEvent.mode !is OS.GDK_CROSSING_UNGRAB) return 0;
 		if ((gdkEvent.state & (OS.GDK_BUTTON1_MASK | OS.GDK_BUTTON2_MASK | OS.GDK_BUTTON3_MASK)) !is 0) return 0;
 		result = sendMouseEvent (SWT.MouseExit, 0, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
@@ -2602,8 +2585,7 @@
 	int result = 0;
 	auto eventPtr = OS.gtk_get_current_event ();
 	if (eventPtr !is null) {
-		GdkEventKey* keyEvent = new GdkEventKey ();
-		memmove (keyEvent, eventPtr, GdkEventKey.sizeof);
+		GdkEventKey* keyEvent = cast(GdkEventKey*)eventPtr;
 		if (keyEvent.type is OS.GDK_KEY_PRESS) {
 			Control focusControl = display.getFocusControl ();
 			auto focusHandle = focusControl !is null ? focusControl.focusHandle () : null;
@@ -2619,9 +2601,7 @@
 	return result;
 }
 
-override int /*long*/ gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* event) {
-	GdkEventMotion* gdkEvent = new GdkEventMotion ();
-	memmove (gdkEvent, event, GdkEventMotion.sizeof);
+override int /*long*/ gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* gdkEvent) {
 	if (this is display.currentControl && (hooks (SWT.MouseHover) || filters (SWT.MouseHover))) {
 		display.addMouseHoverTimeout (handle);
 	}
@@ -2665,9 +2645,7 @@
 	return 0;
 }
 
-override int /*long*/ gtk_scroll_event (GtkWidget* widget, GdkEventScroll* eventPtr) {
-	GdkEventScroll* gdkEvent = new GdkEventScroll ();
-	memmove (gdkEvent, eventPtr, GdkEventScroll.sizeof);
+override int /*long*/ gtk_scroll_event (GtkWidget* widget, GdkEventScroll* gdkEvent) {
 	switch (cast(int)gdkEvent.direction) {
 		case OS.GDK_SCROLL_UP:
 			return sendMouseEvent (SWT.MouseWheel, 0, 3, SWT.SCROLL_LINE, true, gdkEvent.time, gdkEvent.x_root, gdkEvent.y_root, false, gdkEvent.state) ? 0 : 1;
@@ -2700,9 +2678,7 @@
 	return 0;
 }
 
-override int /*long*/ gtk_visibility_notify_event (GtkWidget* widget, GdkEventVisibility* event) {
-	GdkEventVisibility* gdkEvent = new GdkEventVisibility ();
-	memmove (gdkEvent, event, GdkEventVisibility.sizeof);
+override int /*long*/ gtk_visibility_notify_event (GtkWidget* widget, GdkEventVisibility* gdkEvent) {
 	auto paintWindow = paintWindow();
 	auto window = gdkEvent.window;
 	if (window is paintWindow) {
@@ -2712,10 +2688,10 @@
 			if ((state & OBSCURED) !is 0) {
 				int width, height;
 				OS.gdk_drawable_get_size (cast(GdkDrawable*)window, &width, &height);
-				GdkRectangle* rect = new GdkRectangle ();
+				GdkRectangle rect;
 				rect.width = width;
 				rect.height = height;
-				OS.gdk_window_invalidate_rect (window, rect, false);
+				OS.gdk_window_invalidate_rect (window, &rect, false);
 			}
 			state &= ~OBSCURED;
 		}
@@ -2918,7 +2894,7 @@
 	return false;
 }
 
-void register () {
+override void register () {
 	super.register ();
 	if (fixedHandle !is null) display.addWidget (fixedHandle, this);
 	auto imHandle = imHandle ();
@@ -2997,7 +2973,7 @@
 void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) {
 	if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) is 0) return;
 	auto window = paintWindow ();
-	GdkRectangle* rect = new GdkRectangle ();
+	GdkRectangle rect;
 	if (redrawAll) {
 		int w, h;
 		OS.gdk_drawable_get_size (cast(GdkDrawable*)window, &w, &h);
@@ -3009,10 +2985,10 @@
 		rect.width = width;
 		rect.height = height;
 	}
-	OS.gdk_window_invalidate_rect (window, rect, all);
+	OS.gdk_window_invalidate_rect (window, &rect, all);
 }
 
-void release (bool destroy) {
+override void release (bool destroy) {
 	Control next = null, previous = null;
 	if (destroy && parent !is null) {
 		Control[] children = parent._getChildren ();
@@ -3032,17 +3008,17 @@
 	}
 }
 
-void releaseHandle () {
+override void releaseHandle () {
 	super.releaseHandle ();
 	fixedHandle = null;
 	parent = null;
 }
 
-void releaseParent () {
+override void releaseParent () {
 	parent.removeControl (this);
 }
 
-void releaseWidget () {
+override void releaseWidget () {
 	super.releaseWidget ();
 	if (display.currentControl is this) display.currentControl = null;
 	display.removeMouseHoverTimeout (handle);
@@ -3218,9 +3194,9 @@
 	auto ptr = OS.gtk_rc_style_get_bg_pixmap_name (style, index);
 	if (ptr !is null) OS.g_free (ptr);
 	char[] name = color is null ? "<parent>" : "<none>" ;
-    char* pname = toStringz( name );
 	ptr = cast(char*)OS.g_malloc (name.length+1);
-	memmove (ptr, pname, name.length+1);
+    ptr[ 0 .. name.length ] = name;
+    ptr[ name.length ] = '\0';
 	OS.gtk_rc_style_set_bg_pixmap_name (style, index, ptr);
 	OS.gtk_rc_style_set_bg (style, index, color);
 	int flags = OS.gtk_rc_style_get_color_flags (style, index);
@@ -3401,7 +3377,7 @@
 		auto parentHandle = parent.parentingHandle ();
 		auto window = OS.GTK_WIDGET_WINDOW (parentHandle);
 		Rectangle rect = getBounds ();
-		GdkWindowAttr* attributes = new GdkWindowAttr ();
+		GdkWindowAttr attributes;
 		attributes.x = rect.x;
 		attributes.y = rect.y;
 		attributes.width = rect.width;
@@ -3409,7 +3385,7 @@
 		attributes.event_mask = (0xFFFFFFFF & ~OS.ExposureMask);
 		attributes.wclass = OS.GDK_INPUT_ONLY;
 		attributes.window_type = OS.GDK_WINDOW_CHILD;
-		enableWindow = OS.gdk_window_new (window, attributes, OS.GDK_WA_X | OS.GDK_WA_Y);
+		enableWindow = OS.gdk_window_new (window, &attributes, OS.GDK_WA_X | OS.GDK_WA_Y);
 		if (enableWindow !is null) {
 			auto topHandle = topHandle ();
 			OS.gdk_window_set_user_data (enableWindow, parentHandle);
@@ -3421,10 +3397,10 @@
 				auto xWindow = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)enableWindow);
 				int xScreen = OS.XDefaultScreen (xDisplay);
 				int flags = OS.CWStackMode | OS.CWSibling;
-				XWindowChanges* changes = new XWindowChanges ();
+				XWindowChanges changes;
 				changes.sibling = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)topWindow);
 				changes.stack_mode = OS.Above;
-				OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, changes);
+				OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes);
 			}
 			if (OS.GTK_WIDGET_VISIBLE (topHandle)) OS.gdk_window_show_unraised (enableWindow);
 		}
@@ -3553,6 +3529,8 @@
 		resizeHandle (1, 1);
 		forceResize ();
 	}
+        Stdout.formatln( "{}: setInitialBounds gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) );
 }
 
 /**
@@ -3593,7 +3571,7 @@
 	this.menu = menu;
 }
 
-void setOrientation () {
+override void setOrientation () {
 	if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
 		if (handle !is null) OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL);
 		if (fixedHandle !is null) OS.gtk_widget_set_direction (fixedHandle, OS.GTK_TEXT_DIR_RTL);
@@ -3696,12 +3674,12 @@
 			if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) !is 0) {
 				auto window = paintWindow ();
 				Rectangle rect = getBounds ();
-				GdkWindowAttr* attributes = new GdkWindowAttr ();
+				GdkWindowAttr attributes;
 				attributes.width = rect.width;
 				attributes.height = rect.height;
 				attributes.event_mask = OS.GDK_EXPOSURE_MASK;
 				attributes.window_type = OS.GDK_WINDOW_CHILD;
-				redrawWindow = OS.gdk_window_new (window, attributes, 0);
+				redrawWindow = OS.gdk_window_new (window, &attributes, 0);
 				if (redrawWindow !is null) {
 					int mouseMask = OS.GDK_BUTTON_PRESS_MASK | OS.GDK_BUTTON_RELEASE_MASK |
 						OS.GDK_ENTER_NOTIFY_MASK | OS.GDK_LEAVE_NOTIFY_MASK |
@@ -3869,7 +3847,7 @@
 				OS.gdk_window_lower (window);
 			}
 		} else {
-			XWindowChanges* changes = new XWindowChanges ();
+			XWindowChanges changes;
 			changes.sibling = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)(siblingWindow !is null ? siblingWindow : redrawWindow));
 			changes.stack_mode = above ? OS.Above : OS.Below;
 			if (redrawWindow !is null && siblingWindow is null) changes.stack_mode = OS.Below;
@@ -3886,24 +3864,34 @@
 			* When the receiver is not a top level shell, XReconfigureWMWindow ()
 			* behaves the same as XConfigureWindow ().
 			*/
-			OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, changes);
+			OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes);
 			if (enableWindow !is null) {
 				changes.sibling = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)window);
 				changes.stack_mode = OS.Above;
 				xWindow = OS.gdk_x11_drawable_get_xid (cast(GdkDrawable*)enableWindow);
-				OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, changes);
+				OS.XReconfigureWMWindow (xDisplay, xWindow, xScreen, flags, &changes);
 			}
 		}
 	}
+        Stdout.formatln( "{}: setZOrder gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) );
 	if (fixChildren) {
 		if (above) {
+        Stdout.formatln( "{}: setZOrder gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) );
 			parent.moveAbove (topHandle, siblingHandle);
 		} else {
+        Stdout.formatln( "{}: setZOrder gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) );
 			parent.moveBelow (topHandle, siblingHandle);
 		}
 	}
+        Stdout.formatln( "{}: setZOrder gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) );
 	/*  Make sure that the parent internal windows are on the bottom of the stack	*/
 	if (!above && fixChildren) 	parent.fixZOrder ();
+        Stdout.formatln( "{}: setZOrder gtk_container_get_children {:x}", __LINE__, parent.parentingHandle() );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parent.parentingHandle()) );
 
 	if (fixRelations) {
 		/* determine the receiver's new index in the parent */
@@ -3973,8 +3961,11 @@
 	auto topHandle = topHandle ();
 	auto parentHandle = parent.parentingHandle ();
 	parent.setParentWindow (topHandle);
+    Stdout.formatln( "showWidget {:x} {}", parentHandle, topHandle );
+        Stdout.formatln( "showWidget gtk_container_get_children {:x}", parentHandle );
+        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentHandle) );
 	OS.gtk_container_add (cast(GtkContainer*)parentHandle, topHandle);
-	if (handle !is null && handle !is topHandle) OS.gtk_widget_show (handle);
+    if (handle !is null && handle !is topHandle) OS.gtk_widget_show (handle);
 	if ((state & (ZERO_WIDTH | ZERO_HEIGHT)) is 0) {
 		if (fixedHandle !is null) OS.gtk_widget_show (fixedHandle);
 	}
@@ -4254,14 +4245,13 @@
 	/* Do nothing */
 }
 
-int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
+override int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	switch (cast(int)/*64*/user_data) {
 		case EXPOSE_EVENT_INVERSE: {
 			if ((OS.GTK_VERSION <  OS.buildVERSION (2, 8, 0)) && ((state & OBSCURED) is 0)) {
 				Control control = findBackgroundControl ();
 				if (control !is null && control.backgroundImage !is null) {
-					GdkEventExpose* gdkEvent = new GdkEventExpose ();
-					memmove (gdkEvent, cast(void*)arg0, GdkEventExpose.sizeof);
+					GdkEventExpose* gdkEvent = cast(GdkEventExpose*)arg0;
 					auto paintWindow = paintWindow();
 					auto window = gdkEvent.window;
 					if (window !is paintWindow) break;
--- a/dwt/widgets/Decorations.d	Sat Jan 12 01:53:16 2008 +0100
+++ b/dwt/widgets/Decorations.d	Sat Jan 12 07:02:08 2008 +0100
@@ -170,7 +170,7 @@
 	return style;
 }
 
-protected void checkSubclass () {
+override protected void checkSubclass () {
 	if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
 }
 
@@ -229,11 +229,11 @@
 	return data1.width > data2.width || data1.height > data2.height ? -1 : 1;
 }
 
-Control computeTabGroup () {
+override Control computeTabGroup () {
 	return this;
 }
 
-Control computeTabRoot () {
+override Control computeTabRoot () {
 	return this;
 }
 
@@ -246,7 +246,7 @@
 	OS.gtk_window_add_accel_group (cast(GtkWindow*)shellHandle, accelGroup);
 }
 
-void createWidget (int index) {
+override void createWidget (int index) {
 	super.createWidget (index);
 	text = "";
 }
@@ -420,7 +420,7 @@
 	return minimized;
 }
 
-char[] getNameText () {
+override char[] getNameText () {
 	return getText ();
 }
 
@@ -442,20 +442,20 @@
 	return text;
 }
 
-public bool isReparentable () {
+override public bool isReparentable () {
 	checkWidget ();
 	return false;
 }
 
-bool isTabGroup () {
+override bool isTabGroup () {
 	return true;
 }
 
-bool isTabItem () {
+override bool isTabItem () {
 	return false;
 }
 
-Decorations menuShell () {
+override Decorations menuShell () {
 	return this;
 }
 
@@ -469,7 +469,7 @@
 	}
 }
 
-void releaseChildren (bool destroy) {
+override void releaseChildren (bool destroy) {
 	if (menuBar !is null) {
 		menuBar.release (false);
 		menuBar = null;
@@ -486,12 +486,12 @@
 	}
 }
 
-void releaseHandle () {
+override void releaseHandle () {
 	super.releaseHandle ();
 	vboxHandle = null;
 }
 
-void releaseWidget () {
+override void releaseWidget () {
 	super.releaseWidget ();
 	image = null;
 	images = null;
@@ -741,11 +741,11 @@
 	}
 }
 
-bool traverseItem (bool next) {
+override bool traverseItem (bool next) {
 	return false;
 }
 
-bool traverseReturn () {
+override bool traverseReturn () {
 	Button button = defaultButton !is null ? defaultButton: saveDefault;
 	if (button is null || button.isDisposed ()) return false;
 	/*
--- a/dwt/widgets/Scrollable.d	Sat Jan 12 01:53:16 2008 +0100
+++ b/dwt/widgets/Scrollable.d	Sat Jan 12 07:02:08 2008 +0100
@@ -152,13 +152,13 @@
 	return bar;
 }
 
-void createWidget (int index) {
+override void createWidget (int index) {
 	super.createWidget (index);
 	if ((style & SWT.H_SCROLL) !is 0) horizontalBar = createScrollBar (SWT.H_SCROLL);
 	if ((style & SWT.V_SCROLL) !is 0) verticalBar = createScrollBar (SWT.V_SCROLL);
 }
 
-void deregister () {
+override void deregister () {
 	super.deregister ();
 	if (scrolledHandle !is null) display.removeWidget (cast(GtkWidget*)scrolledHandle);
 }
@@ -231,7 +231,7 @@
 	return verticalBar;
 }
 
-int /*long*/ gtk_scroll_event (GtkWidget* widget, GdkEventScroll* eventPtr) {
+override int /*long*/ gtk_scroll_event (GtkWidget* widget, GdkEventScroll* eventPtr) {
 	auto result = super.gtk_scroll_event (widget, eventPtr);
 
 	/*
@@ -274,11 +274,11 @@
 	return requisition.height + spacing;
 }
 
-bool sendLeaveNotify () {
+override bool sendLeaveNotify () {
 	return scrolledHandle !is null;
 }
 
-void setOrientation () {
+override void setOrientation () {
 	super.setOrientation ();
 	if ((style & SWT.RIGHT_TO_LEFT) !is 0) {
 		if (scrolledHandle !is null) {
@@ -308,7 +308,7 @@
 void redrawBackgroundImage () {
 }
 
-void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) {
+override void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) {
 	super.redrawWidget (x, y, width, height, redrawAll, all, trim);
 	if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) is 0) return;
 	if (!trim) return;
@@ -330,17 +330,17 @@
 	OS.gdk_window_invalidate_rect (window, rect, all);
 }
 
-void register () {
+override void register () {
 	super.register ();
 	if (scrolledHandle !is null) display.addWidget (cast(GtkWidget*)scrolledHandle, this);
 }
 
-void releaseHandle () {
+override void releaseHandle () {
 	super.releaseHandle ();
 	scrolledHandle = null;
 }
 
-void releaseChildren (bool destroy) {
+override void releaseChildren (bool destroy) {
 	if (horizontalBar !is null) {
 		horizontalBar.release (false);
 		horizontalBar = null;
@@ -352,17 +352,17 @@
 	super.releaseChildren (destroy);
 }
 
-void resizeHandle (int width, int height) {
+override void resizeHandle (int width, int height) {
 	if (fixedHandle !is null) OS.gtk_widget_set_size_request (cast(GtkWidget*)fixedHandle, width, height);
 	OS.gtk_widget_set_size_request (scrolledHandle !is null ? cast(GtkWidget*)scrolledHandle : handle, width, height);
 }
 
-void showWidget () {
+override void showWidget () {
 	super.showWidget ();
 	if (scrolledHandle !is null) OS.gtk_widget_show (cast(GtkWidget*)scrolledHandle);
 }
 
-GtkWidget* topHandle () {
+override GtkWidget* topHandle () {
 	if (fixedHandle !is null) return fixedHandle;
 	if (scrolledHandle !is null) return scrolledHandle;
 	return super.topHandle ();
--- a/dwt/widgets/Shell.d	Sat Jan 12 01:53:16 2008 +0100
+++ b/dwt/widgets/Shell.d	Sat Jan 12 07:02:08 2008 +0100
@@ -532,11 +532,11 @@
 	display.activePending = true;
 }
 
-void checkBorder () {
+override void checkBorder () {
 	/* Do nothing */
 }
 
-void checkOpen () {
+override void checkOpen () {
 	if (!opened) resized = false;
 }
 
@@ -569,7 +569,7 @@
 	if (event.doit && !isDisposed ()) dispose ();
 }
 
-public Rectangle computeTrim (int x, int y, int width, int height) {
+override public Rectangle computeTrim (int x, int y, int width, int height) {
 	checkWidget();
 	Rectangle trim = super.computeTrim (x, y, width, height);
 	int border = 0;
@@ -591,7 +591,7 @@
 }
 
 alias Decorations.createHandle createHandle;
-void createHandle (int index) {
+override void createHandle (int index) {
 	state |= HANDLE | CANVAS;
 	if (shellHandle is null) {
 		if (handle is null) {
@@ -707,19 +707,19 @@
 	return 0;
 }
 
-Control findBackgroundControl () {
+override Control findBackgroundControl () {
 	return (state & BACKGROUND) !is 0 || backgroundImage !is null ? this : null;
 }
 
-Composite findDeferredControl () {
+override Composite findDeferredControl () {
 	return layoutCount > 0 ? this : null;
 }
 
-bool hasBorder () {
+override bool hasBorder () {
 	return false;
 }
 
-void hookEvents () {
+override void hookEvents () {
 	super.hookEvents ();
 	OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [KEY_PRESS_EVENT], 0, display.closures [KEY_PRESS_EVENT], false);
 	OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [MAP_EVENT], 0, display.closures [MAP_EVENT], false);
@@ -736,7 +736,7 @@
 	//OS.gdk_window_add_filter  (window, display.filterProc, shellHandle);
 }
 
-public bool isEnabled () {
+override public bool isEnabled () {
 	checkWidget ();
 	return getEnabled ();
 }
@@ -747,21 +747,21 @@
 		(style & (SWT.NO_TRIM | SWT.ON_TOP)) !is 0;
 }
 
-public bool isVisible () {
+override public bool isVisible () {
 	checkWidget();
 	return getVisible ();
 }
 
-void register () {
+override void register () {
 	super.register ();
 	display.addWidget (shellHandle, this);
 }
 
-void releaseParent () {
+override void releaseParent () {
 	/* Do nothing */
 }
 
-GtkWidget* topHandle () {
+override GtkWidget* topHandle () {
 	return shellHandle;
 }
 
@@ -793,10 +793,10 @@
 }
 
 alias Decorations.fixStyle fixStyle;
-void fixStyle (int /*long*/ handle) {
+override void fixStyle (GtkWidget* handle) {
 }
 
-void forceResize () {
+override void forceResize () {
 	forceResize (OS.GTK_WIDGET_WIDTH (vboxHandle), OS.GTK_WIDGET_HEIGHT (vboxHandle));
 }
 
@@ -812,7 +812,7 @@
 	OS.gtk_widget_size_allocate (cast(GtkWidget*)vboxHandle, allocation);
 }
 
-public Point getLocation () {
+override public Point getLocation () {
 	checkWidget ();
 	int x, y;
 	OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x,&y);
@@ -841,7 +841,7 @@
 	return new Point (width, height);
 }
 
-public Point getSize () {
+override public Point getSize () {
 	checkWidget ();
 	int width = OS.GTK_WIDGET_WIDTH (vboxHandle);
 	int height = OS.GTK_WIDGET_HEIGHT (vboxHandle);
@@ -852,7 +852,7 @@
 	return new Point (width + trimWidth () + 2*border, height + trimHeight () + 2*border);
 }
 
-public bool getVisible () {
+override public bool getVisible () {
 	checkWidget();
 	return OS.GTK_WIDGET_VISIBLE (shellHandle);
 }
@@ -898,7 +898,7 @@
 	return SWT.NONE;
 }
 
-Shell _getShell () {
+override Shell _getShell () {
 	return this;
 }
 /**
@@ -1664,12 +1664,12 @@
 	return 0;
 }
 
-void deregister () {
+override void deregister () {
 	super.deregister ();
 	display.removeWidget (shellHandle);
 }
 
-public void dispose () {
+override public void dispose () {
 	/*
 	* Note:  It is valid to attempt to dispose a widget
 	* more than once.  If this happens, fail silently.
@@ -1706,7 +1706,7 @@
 	bringToTop (true);
 }
 
-public Rectangle getBounds () {
+override public Rectangle getBounds () {
 	checkWidget ();
 	int x, y ;
 	OS.gtk_window_get_position (cast(GtkWindow*)shellHandle, &x, &y);
@@ -1719,12 +1719,12 @@
 	return new Rectangle (x, y, width + trimWidth () + 2*border, height + trimHeight () + 2*border);
 }
 
-void releaseHandle () {
+override void releaseHandle () {
 	super.releaseHandle ();
 	shellHandle = null;
 }
 
-void releaseChildren (bool destroy) {
+override void releaseChildren (bool destroy) {
 	Shell [] shells = getShells ();
 	for (int i=0; i<shells.length; i++) {
 		Shell shell = shells [i];
@@ -1735,7 +1735,7 @@
 	super.releaseChildren (destroy);
 }
 
-void releaseWidget () {
+override void releaseWidget () {
 	super.releaseWidget ();
 	destroyAccelGroup ();
 	if (display.activeShell is this) display.activeShell = null;
--- a/dwt/widgets/Widget.d	Sat Jan 12 01:53:16 2008 +0100
+++ b/dwt/widgets/Widget.d	Sat Jan 12 07:02:08 2008 +0100
@@ -1472,8 +1472,7 @@
 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) {
 	switch (cast(int)/*64*/user_data) {
 		case EXPOSE_EVENT_INVERSE: {
-			GdkEventExpose* gdkEvent = new GdkEventExpose ();
-			memmove (gdkEvent, cast(void*)arg0, GdkEventExpose.sizeof);
+			GdkEventExpose* gdkEvent = cast(GdkEventExpose*) arg0;
 			auto paintWindow = paintWindow();
 			auto window = gdkEvent.window;
 			if (window !is paintWindow) return 0;
--- a/helloworld.d	Sat Jan 12 01:53:16 2008 +0100
+++ b/helloworld.d	Sat Jan 12 07:02:08 2008 +0100
@@ -3,6 +3,8 @@
 import dwt.SWT;
 import dwt.widgets.Display;
 import dwt.widgets.Shell;
+import dwt.widgets.Composite;
+import dwt.widgets.Button;
 
 import tango.io.Stdout;
 import tango.math.Math;
@@ -50,7 +52,12 @@
         Stdout.formatln( "main entered" );
         Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); display = new Display();
         Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell = new Shell(display);
+        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell.setSize(200, 200);
         Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell.setText("Simple SWT Sample");
+        //Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); auto comp = new Composite( shell, SWT.NONE );
+        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); auto btn = new Button( shell, SWT.TOGGLE );
+        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); btn.setBounds(40, 50, 50, 20);
+        Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); btn.setText( "hey" );
         Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell.open();
         Stdout.formatln( "loop entered" );
         while (!shell.isDisposed()) {