I have nodes with links between them that are programmatically set up. I have implemented a layout strategy (separate from the go components) that figures out where to place the nodes. The nodes show up where they are suppose to, but the links between them do not.
Do you have to position the links physically as well as the nodes? (I would have assumed they lay themselves out based on the ports/nodes they are connected to).
Do you have to override some “draw” functionality to get them to be drawn?
They prevent the auto-updating (like the links connected to ports when a node moves). In normal operation, you shouldn’t play with these “Suspends” properties.
But if you were, it would explain what you are seeing....
So, if you click a button (for example) to do the layout, the nodes move but the links attached don't? Is that what you are seeing?
No… I posted a question on this forum asking if you perform the two steps (setting link to/from port, and adding to port) that if it behind the scenes added them to the doc.
You guys said they did. So why do I need to do all 3? That is pretty redundant.
GoLink link = new GoLink(); // … other initialization of the link … link.FromPort = aNode.Port; link.ToPort = bNode.Port; goView1.Document.Add(link);
this is assuming the aNode and bNode are already part of the GoDocument.
When GoView has been asked to "Paint" itself, it iterates through the GoObjects in the GoView's layers -- layers like Grids and Selection are owned by the GoView, other layers belong to the GoDocument. When it is painting, it doesn't know anything about this link or that node, the view is just going "GoObject at Location 10,15... Paint yourself please". (The objects that get painted first will end up visually being "behind" things painted later.)
If the GoObject isn't in the GoDocument, it doesn't get painted, even if other GoObjects that are in the document have connections to it.
Run the "Object Browser" sample... and at least initially ignore the stuff that hangs off "View2" on the right. It gives you a visual representation of all of the main players in the GoDiagram design.