diff options
author | Kevin Barnes <krbarnes> | 2009-03-02 20:39:42 +0000 |
---|---|---|
committer | Kevin Barnes <krbarnes> | 2009-03-02 20:39:42 +0000 |
commit | 452714f24f515b00ab76d9bacdce42e894494e93 (patch) | |
tree | d1392a45d7bc8914aa4752d3e5cfdfe5bb9618e9 /bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java | |
parent | 5178249fdd1fca0f70d91159c2c3d6a155fa3d86 (diff) | |
download | eclipse.platform.swt-452714f24f515b00ab76d9bacdce42e894494e93.tar.gz eclipse.platform.swt-452714f24f515b00ab76d9bacdce42e894494e93.tar.xz eclipse.platform.swt-452714f24f515b00ab76d9bacdce42e894494e93.zip |
266475 - Control#setBackgroundImage() does not work
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java index 26d64a7260..d1dd5eae50 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java @@ -326,16 +326,20 @@ void sendSelection () { postEvent (SWT.Selection); } -void setBackground (float /*double*/ [] color) { - NSColor nsColor; - if (color == null) { +void updateBackground () { + NSColor nsColor = null; + if (backgroundImage != null) { + nsColor = NSColor.colorWithPatternImage(backgroundImage.handle); + } else if (background != null) { + float /*double*/ [] color = background.handle; + nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1); + } else { if ((style & SWT.CALENDAR) != 0) { nsColor = NSColor.controlBackgroundColor (); } else { nsColor = NSColor.textBackgroundColor (); } - } else { - nsColor = NSColor.colorWithDeviceRed(color[0], color[1], color[2], 1); + } ((NSDatePicker)view).setBackgroundColor(nsColor); } |