Open darkonaito opened 6 months ago
Thanks!
I think this is the consequence of: https://github.com/ArthurSonzogni/FTXUI/blob/main/src/ftxui/component/screen_interactive.cpp#L544-L548
That is to say, after unwrapping the last screen, a new line is inserted at the end, so that the shell's command line starts below and do not override the previous frame.
In your case, there is a single Screen, where Loop
is called multiple time. So a new line is added each time.
I believe this is something we should improve.
In the meantime, I propose two alternatives:
That is to say, use different screen in each function, and call one function while executing the previous one.
Tab
Create a "super" component that will regroup every "page" you want to display.
The "super" component will be a Tab({...pages}, &selected_page)
.
To display a different page, you will have to update the selected_page
integer.
@ArthurSonzogni Using nested screens doesn't seem to work, now I get the whole previous frame
Can confirm, I have the same bug.
The bug seems to be present in the Tab
container too when switching to a new tab. The screen isnt cleared after the first time the new tab is rendered.
For now I'm using a conditional to check whether the new "tab" has already been rendered to decide whether the program should render it again, and it seems to be working good
When I select the menu first option, I get the both the current renderer's text "Now, please enter the server manager's address and port, so that you'll be able to see all the available public servers!" and the previous "Welcome, my client".
I tried using screen.Clear() too, and it didn't work.