For my app, I want a node that always has a label and sometimes (upon user action) shows a small image (from disk) above the label. If there’s no image, I want the node to look like a plain GoBasicNode (no images, no ports, just the label). If there’s an image, I want the image to show up above the label. I’ve tried the GoIconicNode, but the issues I’ve run into are:
- if there’s no image (i.e. the node is initialized with a “null” image), I get a 20x20 black, empty outline (with a dot inside) above the label. I don’t want any of this if there’s no image. I just want the label.
- The label is always on a transparent background (setting Label.BackgroundColor to Color.White doesn’t do anything). I want the label to always have a rectangular background behind the text.
My question: what’s the best approach for this?
- Pursue the GoIconicNode route, assuming there are fixes for the two issues above?
- Create my own GoGroup node, which consists of a GoBasicNode and a GoImage?
- Use a GoBasicNode and add a GoImage as a child to it?
Thanks for any suggestions.