-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Node to a specific location from context menu #15
Comments
Hi, node items in a NodeView have properties x, y, width and height. When creating the particular item, you can set these to place it. Below is the relevant code for C and python, I've added it to the respective demos as well:
|
Hi, In fact, after specifying both "x" and "y", the node is positioned along the diagonal given by the MAX_WIDTH/MAX_HEIGHT. Then, if I only specify "x", then I also need to set the scrolling policy on the "y" axis to AUTOMATIC. |
If you're using pos[2] for y when using the pointer coordinates from the button bar, the value is actually negative since it is outside of the canvas. That appears to be the source of the placement issue. |
Hi, When using the toolbar, the pos[2] is in fact negative. |
Hi,
Regarding adding Nodes to the NodeView using the context menu provided in example "demo.c", can it be possible to set the initial position of a new Node to the position of the mouse right-click?
I found that the NodeView container uses the GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT/HEIGHT_FOR_WIDTH size request mode. But when a sketch is loaded from file, the installed properties "x", "y", "width" and "height" seems to override the layout. Can it be possible to do this when a Node is created on the fly?
Thank you,
Vítor
The text was updated successfully, but these errors were encountered: