summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2009-01-26 22:28:43 +0000
committerSilenio Quarti <silenio>2009-01-26 22:28:43 +0000
commitab7a1436e4ef701e89dc80eaedb4dc69f6c11fec (patch)
tree747207582c5ed9c2acde33964731056d7a91dbcf /bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
parent6064bf54f9c02b013a6336de92e98261a6d27bb2 (diff)
downloadeclipse.platform.swt-ab7a1436e4ef701e89dc80eaedb4dc69f6c11fec.tar.gz
eclipse.platform.swt-ab7a1436e4ef701e89dc80eaedb4dc69f6c11fec.tar.xz
eclipse.platform.swt-ab7a1436e4ef701e89dc80eaedb4dc69f6c11fec.zip
260585 - Font and spacing is a little bit off compared to Carbon
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
index d110aa8557..3d9605db96 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
@@ -48,7 +48,7 @@ import org.eclipse.swt.internal.cocoa.*;
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*/
public class Label extends Control {
- String text = "";
+ String text;
Image image;
boolean isImage;
NSTextField textView;
@@ -247,6 +247,11 @@ void createHandle () {
view = widget;
}
+void createWidget() {
+ text = "";
+ super.createWidget ();
+}
+
NSAttributedString createString() {
NSMutableDictionary dict = NSMutableDictionary.dictionaryWithCapacity(4);
if (foreground != null) {
@@ -276,6 +281,10 @@ NSAttributedString createString() {
return attribStr;
}
+NSFont defaultNSFont () {
+ return display.textFieldFont;
+}
+
void deregister () {
super.deregister ();
if (textView != null) {
@@ -432,6 +441,7 @@ void setFont(NSFont font) {
if (textView != null) {
NSCell cell = new NSCell(textView.cell());
cell.setAttributedStringValue(createString());
+ textView.setFont (font);
}
}