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

How to use in tview #321

Open
sayi65 opened this issue Mar 18, 2022 · 8 comments
Open

How to use in tview #321

sayi65 opened this issue Mar 18, 2022 · 8 comments
Labels
question Further information is requested

Comments

@sayi65
Copy link

sayi65 commented Mar 18, 2022

Hello, my golang project use tview(https://github.com/rivo/tview)
I would like to put this chat in tview, is there a way?

@mum4k mum4k added the question Further information is requested label Mar 18, 2022
@mum4k
Copy link
Owner

mum4k commented Mar 18, 2022

Hello @sayi65 and thank you for reaching out.

I am sorry, but I don't understand the question. Can you help me understand what you mean by "put this chat in tview" ?

@sayi65
Copy link
Author

sayi65 commented Mar 20, 2022

Hello @mum4k

I want to put the barchart in the pages of the tview
I would like to know if there is any way to do this

@mum4k
Copy link
Owner

mum4k commented Mar 22, 2022

Thank you for explaining the question.

I think this would be doable, but you would have to write some API adapters. Looks like tview also uses tcell. Both tview and termdash take over the entire screen with tcell, so they aren't directly compatible. However you could run tview and import just the widget code from the termdash repository. If you then write an adapter from the Widget API to what tview uses when talking to tcell, you should be able to make any widgets from her work with tview.

@sayi65
Copy link
Author

sayi65 commented Mar 22, 2022

@mum4k
Thanks for the response. 

I think I have worked out how to put barchat into tview. However, when I change the screen from barchat to tview, it collapses. The current process is to use the TAB keyboard to change screens. is there any way to clear the barchat?

@mum4k
Copy link
Owner

mum4k commented Mar 23, 2022

@sayi65 thank you for sharing the screenshots.

First we need to ensure that the barchart is no longer periodically drawing itself onto the terminal after we switch away.

Secondly this looks like we may need to instruct tview to clear / redraw the entire screen after we switch away form the barchart and stop drawing it. I am not familiar with tview and its API. Do you know if tview allows such a call?

@sayi65
Copy link
Author

sayi65 commented Mar 23, 2022

@mum4k thank you for your comment.
Does it occur when transitioning from the barchat to the page on the tview side, so there is a process to clear in the barchat?
Since barchat uses containers, is there a way to clear the containers?
If the following function can clear the screen?

func Clear() Option {

@mum4k
Copy link
Owner

mum4k commented Mar 24, 2022

@sayi65 is there any way how you could share the code that produce the images uploaded in the thread? Is there a repository or a branch I could look at?

That might help me to point you to the to a function or a process that would clear the screen.

@sayi65
Copy link
Author

sayi65 commented Mar 29, 2022

@mum4k
Sorry for the late reply.Since this project is private. I will modify the code and share it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants