-
October 20th, 2022, 12:07 #1
- Join Date
- Jul 2018
- Posts
- 92
How to be notified of Selection changes?
Hi everyone,
I was wondering if there is any API functionality to get notified of selection changes.
I would love something like imagecontrol.onSelectionChanged(...) or tokeninstance.onSelect(...). Nothing like this is documented in the API, but the doc is sometimes behind what is actually available. AFAIK selection state is also not stored in the DB, so DB.addHandler(...,"onUpdate",...) won't help either.
Failing that, what would be good opportunities to poll imagecontrol.getSelectedTokens to check for changes myself? tokeinstance.onClickRelease does not work, since the selection is updated only after the click event is fully processed. Same goes for imagecontrol.onCursorModeChange (again imagecontrol.getSelectedTokens gives the old selection).
The only other thing I could think of would be to use imagecontrol.onHover and tokeninstance.onHover, but that will be a lot of polls, comparing possibly large tables. I'm worried about the performance impact here.
Anyone have an idea or suggestion?
-
October 20th, 2022, 20:33 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,598
There are no events in the API for this UI action.
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks