diff dwt/widgets/Button.d @ 58:a5c274fa5af9

extended helloworld crashing
author Frank Benoit <benoit@tionex.de>
date Sat, 12 Jan 2008 07:02:08 +0100
parents 93981635e709
children 8cec8f536af3
line wrap: on
line diff
--- 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);