At 27.09.2013 13:13, Bao Niu wrote:To me this sounds like a bug in your code. Isn't it that you just don't know how to achieve this?
Syndrome: If you have a "Database -- Table" on screen, and then add a
"Standard - BezierLine" connecting to one of the table's connection point,
you cannot use python's API to disconnect this two objects
programmatically.
When using layer.remove(BezierLine),Apparently you are assuming layer.remove() is also deleting the object, which it is not. Object destruction is triggered by the object's destroy() method, it includes breaking the remaining object connections. A weak spot is, that it's in the resposibility of the API user to not access the object after destruction.
Are you expecting a display update from update_connections()?
and then
update_connections(table), the connection is still there
In all you described so far you did not try to disconnect at all. You are just assuming that removing an object (from a layer) should also get rid of the connection. If you really want to disconnect there is Handle.connect(None) to do this. But of course that would not delete the object, but just break the connection.
The only way you
can disconnect the two is manually delete the BezierLine from the screen.
There is no way to do this programmatically.
As I said, I think the bug is in your code/assumptions. If you want help debugging actually providing a minimal, but complete example for the issue you have would be helpful.
This seems to be a bug. Is there any solution?
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it. -- Dilbert
_______________________________________________
dia-list mailing list
dia-list gnome org
https://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia