navidys / tvxwidgets

tvxwidgets provides extra widgets for tview
MIT License
146 stars 12 forks source link

"dialog" without being root #46

Open OsvaldoTCF opened 6 months ago

OsvaldoTCF commented 6 months ago

Would you have any example of using the dialog without being root?

navidys commented 6 months ago

Hi @OsvaldoTCF

Sorry I didn't understand your question , do you mean running dialog on top of another widget ?

mkozjak commented 6 months ago

Interested in this too. For example, having a dialog above the flex, which is my root for the app.

greybackcodemonkey commented 5 months ago

To have dialog "above" other components in tview, you can either add your dialog to Pages component and then use ShowPage(...) and SendToFront(...) to put dialog above other visible components from Pages (in contrast to SwitchToPage(...), that will hide everything besides the dialog).

Alternatively you can lean into mechanism of creating new tview components, have your main window embed, for example Flex, then have dialog stay as "free" component (e.g. do not add it to flex) and override "Draw(...)" function in your new component by first calling Flex Draw and then dialog Draw(...) (note that in this case you also need to override Focus, HasFocus and InputHandler methods

github-actions[bot] commented 4 months ago

A friendly reminder that this issue had no activity for 30 days.