Skip to content
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

Programatic selection of node should always happen without timers #821

Closed
joachimmarder opened this issue Aug 17, 2018 · 1 comment
Closed
Assignees
Labels
Enhancement In Development Open for Discussion There are several possibilites to address the issue and anyone is invited for comments.
Milestone

Comments

@joachimmarder
Copy link
Contributor

joachimmarder commented Aug 17, 2018

We have the flag tsSynchMode in Virtual TreeView that allows to perform operation without using timers. We should use this to avoid the use of timers if a node is selected programatically. I don't see a point in delaying the notification the selection change through the OnChnage event in this case, and the use of timer here can cause very strange runtime behavior.

@joachimmarder joachimmarder self-assigned this Aug 17, 2018
@joachimmarder joachimmarder added Open for Discussion There are several possibilites to address the issue and anyone is invited for comments. Enhancement labels Aug 17, 2018
@joachimmarder joachimmarder added this to the V7.1 milestone Aug 17, 2018
@obones
Copy link
Contributor

obones commented Nov 5, 2018

I'm not doing this, but maybe someone, somewhere is recreating the underlying nodes when a change occurs, meaning that the PVirtualNode instance disappears before the code that triggered the change has finished.
If this is done inside a keyboard event from the virtual tree itself, it may very well try to access a destroyed node, with the consequences that everyone can imagine.
The usual way to circumvent this is to post a message and do the "suicide" code inside the handler, but it can also be done with timers. Maybe this is the reason why they are here, even if I dislike them as much as you do.

@joachimmarder joachimmarder modified the milestones: V7.1, V7.2 Nov 29, 2018
joachimmarder added a commit that referenced this issue Jan 16, 2019
…'t be able to select another node with the mouse within the change delay. Issue #821.
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Jan 17, 2019
…on() that allows to force a synced selection. We now pass true in cases where a programamtic selection takes place, but still not in cases where the user performs the (single) selection.

* Like AddToSelection() now RemoveFromSelection() now calls Invalidate() node, in order to unify their behavior.
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Jan 17, 2019
Sharlikran pushed a commit to ElminsterAU/Virtual-TreeView that referenced this issue Jan 17, 2019
…'t be able to select another node with the mouse within the change delay. Issue JAM-Software#821.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement In Development Open for Discussion There are several possibilites to address the issue and anyone is invited for comments.
Projects
None yet
Development

No branches or pull requests

2 participants