[GH-ISSUE #654] Context Menus #480

Closed
opened 2026-03-04 01:05:21 +03:00 by kerem · 6 comments
Owner

Originally created by @ghost on GitHub (Sep 23, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/654

Originally created by @ghost on GitHub (Sep 23, 2021). Original GitHub issue: https://github.com/rivo/tview/issues/654
kerem closed this issue 2026-03-04 01:05:21 +03:00
Author
Owner

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

Please provide a description.

<!-- gh-comment-id:927351840 --> @rivo commented on GitHub (Sep 26, 2021): Please provide a description.
Author
Owner

@ghost commented on GitHub (Sep 26, 2021):

Please provide a description.

@rivo looks like there is an open PR implementing context menus to tview.

<!-- gh-comment-id:927355199 --> @ghost commented on GitHub (Sep 26, 2021): > Please provide a description. @rivo looks like there is an [open PR](https://github.com/rivo/tview/pull/434) implementing context menus to tview.
Author
Owner

@rivo commented on GitHub (Sep 27, 2021):

Ok, got it. Yeah, it's currently not very high on the todo list. But I understand cview has this implemented?

<!-- gh-comment-id:927816854 --> @rivo commented on GitHub (Sep 27, 2021): Ok, got it. Yeah, it's currently not very high on the todo list. But I understand `cview` has this implemented?
Author
Owner

@ghost commented on GitHub (Sep 27, 2021):

Ok, got it. Yeah, it's currently not very high on the todo list. But I understand cview has this implemented?

Looks like cview does implement context menus, but there are few issues with cview, here are some of them:

  • Though cview's API is fairly identical to tview's, it consists of breaking changes. Furthermore, some of the functions like TreeNode.GetLevel() are missing.
  • The repository is self-hosted which makes it difficult for me to open issues and pull requests (you cannot login with GitHub).
<!-- gh-comment-id:927966195 --> @ghost commented on GitHub (Sep 27, 2021): > Ok, got it. Yeah, it's currently not very high on the todo list. But I understand `cview` has this implemented? Looks like cview does implement context menus, but there are few issues with cview, here are some of them: - Though cview's API is fairly identical to tview's, it consists of breaking changes. Furthermore, some of the functions like TreeNode.GetLevel() are missing. - The repository is self-hosted which makes it difficult for me to open issues and pull requests (you cannot login with GitHub).
Author
Owner

@rivo commented on GitHub (Sep 27, 2021):

To be honest, I don't follow cview's progress so I can't tell you anything about its current state. (I don't even know if it's still actively maintained.)

Anyway, I was thinking you might be able to implement context menus yourself by intercepting mouse events with SetMouseCapture(). Now you need to place a context menu widget (e.g. a List) where the user clicked. You can take a clue from this Wiki page.

I would think it's possible even without having this specific functionality part of the library.

<!-- gh-comment-id:927996464 --> @rivo commented on GitHub (Sep 27, 2021): To be honest, I don't follow `cview`'s progress so I can't tell you anything about its current state. (I don't even know if it's still actively maintained.) Anyway, I was thinking you might be able to implement context menus yourself by intercepting mouse events with [`SetMouseCapture()`](https://pkg.go.dev/github.com/rivo/tview#Box.SetMouseCapture). Now you need to place a context menu widget (e.g. a `List`) where the user clicked. You can take a clue from [this Wiki page](https://github.com/rivo/tview/wiki/Modal). I would think it's possible even without having this specific functionality part of the library.
Author
Owner

@ghost commented on GitHub (Sep 27, 2021):

To be honest, I don't follow cview's progress so I can't tell you anything about its current state. (I don't even know if it's still actively maintained.)

Anyway, I was thinking you might be able to implement context menus yourself by intercepting mouse events with SetMouseCapture(). Now you need to place a context menu widget (e.g. a List) where the user clicked. You can take a clue from this Wiki page.

I would think it's possible even without having this specific functionality part of the library.

👍 Alright, sounds great, closing this issue

<!-- gh-comment-id:928044762 --> @ghost commented on GitHub (Sep 27, 2021): > To be honest, I don't follow `cview`'s progress so I can't tell you anything about its current state. (I don't even know if it's still actively maintained.) > > Anyway, I was thinking you might be able to implement context menus yourself by intercepting mouse events with [`SetMouseCapture()`](https://pkg.go.dev/github.com/rivo/tview#Box.SetMouseCapture). Now you need to place a context menu widget (e.g. a `List`) where the user clicked. You can take a clue from [this Wiki page](https://github.com/rivo/tview/wiki/Modal). > > I would think it's possible even without having this specific functionality part of the library. :+1: Alright, sounds great, closing this issue
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#480
No description provided.