summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2002-05-03 17:47:21 +0000
committerSilenio Quarti <silenio>2002-05-03 17:47:21 +0000
commit6d842225f60e347e4e85dbc880baacea4e19ba29 (patch)
treef7ef5ca2c2bc391633a3f4083ad657cdbdc78c09 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
parentbd8da331f502cdc4f38173c93a07c181211e33d8 (diff)
downloadeclipse.platform.swt-6d842225f60e347e4e85dbc880baacea4e19ba29.tar.gz
eclipse.platform.swt-6d842225f60e347e4e85dbc880baacea4e19ba29.tar.xz
eclipse.platform.swt-6d842225f60e347e4e85dbc880baacea4e19ba29.zip
*** empty log message ***
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java28
1 files changed, 24 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
index 94accf4139..bfa0d20dfa 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java
@@ -25,7 +25,7 @@ import org.eclipse.swt.graphics.*;
*/
public class TabItem extends Item {
- int pageHandle;
+ int labelHandle, pixmapHandle, pageHandle;
Control control;
TabFolder parent;
String toolTipText;
@@ -162,6 +162,11 @@ void releaseChild () {
parent.destroyItem (this);
}
+void releaseHandle () {
+ super.releaseHandle ();
+ labelHandle = pixmapHandle = 0;
+}
+
void releaseWidget () {
super.releaseWidget ();
parent = null;
@@ -199,16 +204,26 @@ public void setControl (Control control) {
}
void setFontDescription (int font) {
- OS.gtk_widget_modify_font (handle, font);
+ OS.gtk_widget_modify_font (labelHandle, font);
+ OS.gtk_widget_modify_font (pixmapHandle, font);
}
void setForegroundColor (GdkColor color) {
- OS.gtk_widget_modify_fg (handle, 0, color);
+ OS.gtk_widget_modify_fg (labelHandle, 0, color);
+ OS.gtk_widget_modify_fg (pixmapHandle, 0, color);
}
public void setImage (Image image) {
checkWidget ();
super.setImage (image);
+ if (image != null) {
+ OS.gtk_pixmap_set (pixmapHandle, image.pixmap, image.mask);
+ OS.gtk_widget_show (pixmapHandle);
+ } else {
+ Display display = getDisplay ();
+ OS.gtk_pixmap_set (pixmapHandle, display.nullPixmap, 0);
+ OS.gtk_widget_hide (pixmapHandle);
+ }
}
public void setText (String string) {
@@ -222,7 +237,12 @@ public void setText (String string) {
if (text [i] == '&') text [i] = '_';
}
byte [] buffer = Converter.wcsToMbcs (null, text);
- OS.gtk_label_set_text_with_mnemonic (handle, buffer);
+ OS.gtk_label_set_text_with_mnemonic (labelHandle, buffer);
+ if (string.length () != 0) {
+ OS.gtk_widget_show (labelHandle);
+ } else {
+ OS.gtk_widget_hide (labelHandle);
+ }
parent.fixPage ();
}