Submitted by Anonymous on Mon, 01/28/2002 - 22:17. Developers
To create a container that displays its children in a tree form I used
tree = XtVaCreateWidget("tree", xmContainerWidgetClass, parent,
XmNlayoutType, XmOUTLINE, .....);
I can add children before AND after the container has been managed and realized using
node = XtVaCreateManagedWidget("node",
xmIconGadgetClass, tree,
XmNentryParent, node_parent, ....);
My question is how to delete any of the nodes (IconGadgets). When I use XtDestroyWidget(node) the widget disappears but it seems like its parent (i.e its XmNentryParent) doesn`t get notified of that. For example, if I destroy all the children of a node, it still shows the outline button, and calling XmContainerGetItemChildren(tree, node_parent, ..)
causes a core dump. How can I safely remove a container child??
Hmmm. That should work. Are you both destroying and then re-creating children widgets in the same callback or a function of extended duration? Or do you destroy the children and then permit Xt to return to the event loop, where it handles the destruction?
Hi dbl,
I just destroy widgets in a "delete button" callback, so there might be more than one widget destroyed, but none created.
I think the XtDestroy works ok, because the nodes disappear from the tree, but the problem is that their parent node is not affected properly, as I said it gives a core dump when I try to do XmContainerGetItemChildren.
Thanks dbl.