Replies: 1 comment 1 reply
-
Hello, I'm a little bit new to ftxui, but for what I understand, the call to Renderer(plus_button, [&]{ ...}) overwrite preceding call. If it's suitable for you, you will have to build 3 differents button with same "handling" function. Sorry, if this does not suite your need. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am creating an application where there needs to be several views/screens that the user can change between at runtime. Each view has many of the same components, and the main difference between each view is the visual layout of the components on the screen.
My first thought was to use Container::Tab, but I can't figure out the correct way to do it when I have the same component that must appear in several tabs. Here is a minimal example which demonstrates what I am talking about:
If you run this (or you can probably tell just looking at it) you'll see that the button only works in tab3, presumably because I am not able to pass the same component to multiple renderers like I am doing here. What is the correct way to do this? Is there a way around this limitation with tabs?
Alternatively, I've tried instead of using tabs, to simply conditionally render different elements in the main renderer of my application depending on the value of a integer flag that denotes the desired view. This somewhat works, however I couldn't figure out a good way to define the main container(s) for my application when the visual layout changes drastically between views, and the input (mouse and keyboard) ends up being quite strange.
Any suggestions on how best to approach this problem with FTXUI would be appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions