Delete node when single shape is deleted

I wrote an own node class (derived from GoNode). It contains a
background resizable and reshapable shape (GoRectange). The background
shape is the selectable object. The node class also has some other
elements (e.g. a movable label and an optional image).

And when a node is selected and i press key only the selected background shape is being deleted.

If i understand it correctly there are three possible ways:

  1. Drop all GoObjects in (override) MyNodeClass.Remove for selectable background shape.
  2. Use an event of my GoView to delete node.
  3. Is there a tool class i can modify to do this.

What is the best practice to delete the whole node once user presses ?

Maybe the problem is that that background shape is Selectable. It probably shouldn’t be, unless you really want users to be able select and manipulate that background shape by itself.
If you look at the example classes, you’ll see that the GoNode is normally Selectable and that its SelectionObject (if different from the whole node itself) is a child object. That child object is normally NOT Selectable, but may well be Resizable.
It often provides the node’s Location too, as if the other children of the node were not important in determining the node’s Location. (But those other children do determine the node’s Position and Size and Bounds, of course.) But whether the SelectionObject implements the node’s Location depends on what effect you want.

Yes, my background shape had been selectable = true. Thx again for your quick help :-)