ArthurSonzogni / FTXUI

:computer: C++ Functional Terminal User Interface. :heart:
MIT License
6.86k stars 411 forks source link

Components as Elements ? #503

Closed Darleanow closed 1 year ago

Darleanow commented 1 year ago

Hello, I wanted to know if there was any way to cast Comonents as Elements, for example for submenus, you can make a menu with a submenu, but i'm trying to make submenus under submenus, or is there any way to do it ?

Thanks, Darleanow

ArthurSonzogni commented 1 year ago

Hello and welcome!

cast Comonents as Elements

To produce an Element from a Component, this is the Render function.

component->Render()

you can make a menu with a submenu

What about using a first Menu, whose index is used to select the right submenu from a Container::Tab() containing all the submenu? I think you can try the example: https://github.com/ArthurSonzogni/FTXUI/blob/master/examples/component/tab_vertical.cpp

and replace all the Radiobox with the sub Menu.

Darleanow commented 1 year ago

Hello sir, Thanks for replying this fast,

I actually did something like this, my code isn’t on a github repo but it’ll be soon !

And yeah basically I have a vertical tab, with another menu ! And I can get the parameters from it, so i just made a if else and will be generating the elements from it

Regards, Hugonnier Enzo

Le 25 oct. 2022 à 20:45, Arthur Sonzogni @.***> a écrit :

 Hello and welcome!

cast Comonents as Elements

To produce an Element from a Component, this is the Render function.

component->Render() you can make a menu with a submenu

What about using a first Menu, whose index is used to select the right submenu from a Container::Tab() containing all the submenu? I think you can try the example: https://github.com/ArthurSonzogni/FTXUI/blob/master/examples/component/tab_vertical.cpp

and replace all the Radiobox with the sub Menu.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

ArthurSonzogni commented 1 year ago

I think we can close this issue, isn't it?

Darleanow commented 1 year ago

Indeed, Thanks

Le 10 nov. 2022 à 14:30, ArthurSonzogni @.***> a écrit :

 Closed #503 as completed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.