[GH-ISSUE #579] treeview changed callback behavior changed #425

Closed
opened 2026-03-04 01:04:52 +03:00 by kerem · 3 comments
Owner

Originally created by @polothy on GitHub (Mar 14, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/579

If you scroll to the bottom of change set github.com/rivo/tview@4624fa9b67, you will see the removal of t.process().

This had (I think) an unintended side effect. I'm using the SetChangedFunc function to register a callback that updates other views whenever the currently selected treeview item changes. The other views show extended details about the currently selected treeview item.

With the removal of t.process() in the input event loop, the updates to other views does not get drawn. Instead, the other views show the last selected treeview item instead of the currently selected.

Maybe there is a better way to accomplish what I'm doing? I tried calling various draw and update functions in my callback, but those ended in deadlocks.

Thanks for any help in advance! Cheers 🍻

Originally created by @polothy on GitHub (Mar 14, 2021). Original GitHub issue: https://github.com/rivo/tview/issues/579 If you scroll to the bottom of change set https://github.com/rivo/tview/commit/4624fa9b671e8c401922c1794ec40c392229e464, you will see the removal of `t.process()`. This had (I think) an unintended side effect. I'm using the `SetChangedFunc` function to register a callback that updates other views whenever the currently selected treeview item changes. The other views show extended details about the currently selected treeview item. With the removal of `t.process()` in the input event loop, the updates to other views does not get drawn. Instead, the other views show the last selected treeview item instead of the currently selected. Maybe there is a better way to accomplish what I'm doing? I tried calling various draw and update functions in my callback, but those ended in deadlocks. Thanks for any help in advance! Cheers 🍻
kerem closed this issue 2026-03-04 01:04:52 +03:00
Author
Owner

@polothy commented on GitHub (Mar 14, 2021):

Just wanted to add: I did try adding this line back and prior behavior was restored. I'm not sure if that's the actual fix though.

<!-- gh-comment-id:798945181 --> @polothy commented on GitHub (Mar 14, 2021): Just wanted to add: I did try adding this line back and prior behavior was restored. I'm not sure if that's the actual fix though.
Author
Owner

@rivo commented on GitHub (Apr 26, 2021):

It was. I guess I did not remember that process() also fired the changed callback.

Thanks.

<!-- gh-comment-id:826894570 --> @rivo commented on GitHub (Apr 26, 2021): It was. I guess I did not remember that `process()` also fired the `changed` callback. Thanks.
Author
Owner

@polothy commented on GitHub (Apr 26, 2021):

Awesome, TYVM!

<!-- gh-comment-id:827018323 --> @polothy commented on GitHub (Apr 26, 2021): Awesome, TYVM!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#425
No description provided.