ext menu button:
    function makeButton(text, action, visiblePredicate) {
      const textBlock = new go.TextBlock(text, { click: action });
      // don't bother with binding GraphObject.visible if there's no predicate
      if (visiblePredicate)
        textBlock.bindObject('visible', '', (o, e) => (o.diagram ? visiblePredicate(o, e) : false));

      return go.GraphObject.build('ContextMenuButton').add(textBlock);
    }

    // when the document is modified, add a "*" to the title and enable the "Save" 