currently the only available method to select an object, is to use GUI-interaction (mouse) or simulate this via "mouse"-messages to the canvas.
both things only work with gui enabled and have problems with overlapping objects.
the attached patch (against current svn) adds following messages to the canvas:
- select <id>
- deselect <id>
- deselectall
they allow programmatic selection of objects; <id> is the same object-id as used e.g. for the "connect" message.
this also allows programmatic deletion of objects-per-id, e.g. by sending a message "deselectall, select 14, cut" to the canvas.
Anonymous
File Added: objectselection.diff
Wouldn't it be better just to have a "delete" method? Selecting only makes sense if the
object is visible anyhow, forcing you to have stuff visible to edit it programmatically.
If this is indeed what is wanted, it should be fixed so as not to crash when y runs off the
glist and goes to zero.
well, yes...
however: "select" would allow for both selecting and deleting (with the "cut" message)
if a "delete <id>" message was added, i would be happy as well.
once you are at it, i would add both "delete" and "select" message, though...
"select" messages (git patch)
"delete" messages (git patch)
attached are 2 updated patches, one adding the "select" messages and one adding the "delete" message