[GH-ISSUE #502] Feature request: get a treenode's level #365

Closed
opened 2026-03-04 01:04:21 +03:00 by kerem · 1 comment
Owner

Originally created by @rfc2119 on GitHub (Sep 19, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/502

Hi, I'd like to first thank you warmly for this library. Truly every aspect of the library is well-written. Thank you

I have a situation where I need to act differently based upon the level of current tview.TreeNode in a tview.TreeView. Ideally, I would like to have a GetLevelIndex() method on a TreeNode type, which simply returns the unexported level integer. Would that be an issue to add ?

Originally created by @rfc2119 on GitHub (Sep 19, 2020). Original GitHub issue: https://github.com/rivo/tview/issues/502 Hi, I'd like to first thank you warmly for this library. Truly every aspect of the library is well-written. Thank you I have a situation where I need to act differently based upon the level of current `tview.TreeNode` in a `tview.TreeView`. Ideally, I would like to have a `GetLevelIndex()` method on a TreeNode type, which simply returns the unexported `level` integer. Would that be an issue to add ?
kerem closed this issue 2026-03-04 01:04:21 +03:00
Author
Owner

@rivo commented on GitHub (Dec 4, 2020):

I added this in the latest commit. Let me know if this works for you.

<!-- gh-comment-id:738860212 --> @rivo commented on GitHub (Dec 4, 2020): I added this in the latest commit. Let me know if this works for you.
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#365
No description provided.