summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2005-08-03 16:51:20 +0000
committerSteve Northover <steve>2005-08-03 16:51:20 +0000
commit49347c4afb78420436b6f63c128da2b0e84daf48 (patch)
tree42a217656a4aacd289b3ef8c1c1155585ce924fe /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java
parenta8fe7fa652b2c448593d21d19716eb7fa1ff718a (diff)
downloadeclipse.platform.swt-49347c4afb78420436b6f63c128da2b0e84daf48.tar.gz
eclipse.platform.swt-49347c4afb78420436b6f63c128da2b0e84daf48.tar.xz
eclipse.platform.swt-49347c4afb78420436b6f63c128da2b0e84daf48.zip
105591 - Problems setting and updating an Image on a Label
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java
index 3fb0eb85ae..8e950d46ab 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java
@@ -313,12 +313,13 @@ public void setImage (Image image) {
if ((style & SWT.SEPARATOR) != 0) return;
if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
this.image = image;
- int oldBits = OS.GetWindowLong (handle, OS.GWL_STYLE);
- int newBits = oldBits & ~(OS.SS_LEFTNOWORDWRAP | OS.SS_CENTER | OS.SS_RIGHT) | OS.SS_OWNERDRAW;
- if (oldBits != newBits) {
- OS.SetWindowLong (handle, OS.GWL_STYLE, newBits);
- OS.InvalidateRect (handle, null, true);
+ int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
+ if ((bits & OS.SS_OWNERDRAW) != OS.SS_OWNERDRAW) {
+ bits &= ~(OS.SS_LEFTNOWORDWRAP | OS.SS_CENTER | OS.SS_RIGHT);
+ bits |= OS.SS_OWNERDRAW;
+ OS.SetWindowLong (handle, OS.GWL_STYLE, bits);
}
+ OS.InvalidateRect (handle, null, true);
}
/**