In NodeLinkDemo you can copy a node. Then with the mouse hovered over the LimitingSubGraph, you can rightclick and get the View’s context menu so that you can paste the node. In my project I can copy a node but when I hover over the LimitingSubGraph and rightclick I do not get the context menu to popup to paste the node into the LimitingSubGraph. However, If I hover over the View and rightclick I get the context menu and can paste the node into the view. It appears like the LimitingSubGraph obsures the view’s background so that the rightclick is not detected. Any idea as to how/why this works in the NodeLinkDemo? That is the behavior I want.
Have you added a background object to the subgraph?
Yes, I have a GoRectangle that covers the entire LimitingSubGraph. It is there so I can set the background color. So, that makes sense that the GoRectangle occludes the view from getting the click event. Do you know of a workaround?
You can set BackgroundColor, BorderPen and Corner properties in GoSubGraph to affect appearance without adding a background object.
And GoObject has context menu support, so you could add that to your rectangle if for some reason you need to keep it.
Thanks Jake. As it turns out I do need my GoRectangle. I have tried to add a context menu and I get the “Paste” option to display. However, when I click it it does not add another Node to my SubGraph. But when I click directly on the View it does. Below is the code snipet:
GoContextMenu cm = myBorder.GetContextMenu(view);
I found my problem, Thanks for your help. Here’s the change I made to fix the problem:
public void Paste_Command(Object sender, EventArgs e)
GoView v = MainForm.App.GetCurrentGoView();