Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Shingarov2002-03-13 00:52:35 +0000
committerBoris Shingarov2002-03-13 00:52:35 +0000
commit394891641db209378bfa1b8dc1df3cbd48fc8e76 (patch)
tree6617d180e079f9f7781364e1cde758edb6649644
parent8f132a7d185c45dc3e44560a276d1bf307a9659e (diff)
downloadeclipse.platform.swt-394891641db209378bfa1b8dc1df3cbd48fc8e76.tar.gz
eclipse.platform.swt-394891641db209378bfa1b8dc1df3cbd48fc8e76.tar.xz
eclipse.platform.swt-394891641db209378bfa1b8dc1df3cbd48fc8e76.zip
setControl() works
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/ToolItem.java10
2 files changed, 4 insertions, 16 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
index c5549c95b0..8d8c8409c0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
@@ -510,11 +510,7 @@ public void setControl (Control control) {
Control newControl = control;
Control oldControl = this.control;
if (oldControl == newControl) return;
- if (oldControl != null) {
- int topHandle = control.topHandle ();
-// int tempHandle = parent.tempHandle;
-// OS.gtk_widget_reparent (topHandle, tempHandle);
- }
+
this.control = newControl;
if (newControl != null) {
if (handle != boxHandle) {
@@ -522,9 +518,7 @@ public void setControl (Control control) {
OS.gtk_widget_destroy (handle);
handle = boxHandle;
}
- int topHandle = control.topHandle ();
- OS.gtk_widget_reparent (topHandle, boxHandle);
- //OS.gtk_widget_show (topHandle);
+ OS.gtk_widget_reparent (newControl.topHandle(), boxHandle);
} else {
boolean isVertical = (parent.getStyle () & SWT.VERTICAL) != 0;
handle = isVertical ? OS.gtk_hseparator_new () : OS.gtk_vseparator_new ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/ToolItem.java
index c5549c95b0..8d8c8409c0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/ToolItem.java
@@ -510,11 +510,7 @@ public void setControl (Control control) {
Control newControl = control;
Control oldControl = this.control;
if (oldControl == newControl) return;
- if (oldControl != null) {
- int topHandle = control.topHandle ();
-// int tempHandle = parent.tempHandle;
-// OS.gtk_widget_reparent (topHandle, tempHandle);
- }
+
this.control = newControl;
if (newControl != null) {
if (handle != boxHandle) {
@@ -522,9 +518,7 @@ public void setControl (Control control) {
OS.gtk_widget_destroy (handle);
handle = boxHandle;
}
- int topHandle = control.topHandle ();
- OS.gtk_widget_reparent (topHandle, boxHandle);
- //OS.gtk_widget_show (topHandle);
+ OS.gtk_widget_reparent (newControl.topHandle(), boxHandle);
} else {
boolean isVertical = (parent.getStyle () & SWT.VERTICAL) != 0;
handle = isVertical ? OS.gtk_hseparator_new () : OS.gtk_vseparator_new ();

Back to the top