mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #432] Next node TreeView #313
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#313
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xidod on GitHub (Apr 18, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/432
Hello, I'm missing something or is not possible from code go to the next or previous node in the TreeView?
I mean the same thing that arrow up and arrow down do.
For example, if I want every 5 seconds go to the next node from selected node, how I can do this?
We have GetRowCount() and GetScrollOffset but not the list of the nodes.
@tslocum commented on GitHub (May 2, 2020):
This is implemented in #437
@rivo commented on GitHub (May 7, 2020):
@xidod
TreeViewis not a linear structure and while it internally (and temporarily) keeps a slice of visible nodes, this is not exposed to avoid users tampering with it. (And because it's temporary, there cannot be any guarantees for that slice.) Have you tried sending a key event to the tree view?If this happens in a goroutine, you should use
Application.QueueUpdateDraw()(see the Wiki for details).I haven't tried this myself so it would be good to get some feedback from you. If this doesn't help, I may have to add the corresponding functions.
@xidod commented on GitHub (May 7, 2020):
@rivo sure, i will try this and i give you a feedback asap
@xidod commented on GitHub (May 8, 2020):
yes, i can go to the next node and previous node with
tcell.NewEventKey(tcell.KeyDown,0,tcell.ModeNone)andtcell.NewEventKey(tcell.KeyUp,0,tcell.ModeNone)a little tricky but it works.
@rivo commented on GitHub (Dec 17, 2022):
There is now a function
TreeView.Move()that does this.