diff options
author | Veronika Irvine | 2005-03-28 22:07:56 +0000 |
---|---|---|
committer | Veronika Irvine | 2005-03-28 22:07:56 +0000 |
commit | 23fc8c95fbcf8582a842db17d1b67d4350ee089c (patch) | |
tree | e2051a1b0d0bf8b2c8f3e2d45cf876fa6a8b0d96 | |
parent | bd89ec28ce4c03e69b002e4e21dcd2b0f9ced25d (diff) | |
download | eclipse.platform.swt-23fc8c95fbcf8582a842db17d1b67d4350ee089c.tar.gz eclipse.platform.swt-23fc8c95fbcf8582a842db17d1b67d4350ee089c.tar.xz eclipse.platform.swt-23fc8c95fbcf8582a842db17d1b67d4350ee089c.zip |
add removeAll to TreeItem
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java index d47f962120..48680cb29a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java @@ -840,6 +840,26 @@ void releaseWidget () { cellFont = null; } +public void removeAll () { + checkWidget (); + int length = OS.gtk_tree_model_iter_n_children (parent.modelHandle, handle); + if (length == 0) return; + int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + int [] index = new int [1]; + boolean valid = OS.gtk_tree_model_iter_children (parent.modelHandle, iter, handle); + while (valid) { + OS.gtk_tree_model_get (parent.modelHandle, iter, Tree.ID_COLUMN, index, -1); + valid = OS.gtk_tree_model_iter_next (parent.modelHandle, iter); + TreeItem item = parent.items [index [0]]; + if (item != null) { + item.releaseChild (); + item.releaseWidget (); + item.destroyWidget (); + } + } + OS.g_free (iter); +} + /** * Sets the receiver's background color to the color specified * by the argument, or to the default system color for the item |