[Python] nicegui rendering ui in the background [closed]

Discussão em 'Python' iniciado por Stack, Junho 4, 2025.

  1. Stack

    Stack Membro Participativo

    I have an app of 3 tabs from which you can switch around, and with each tab, there is a button says 'help'. when you click it, there will be a window pops up with a little help info along with some text in 'label' appended to the page. The order that they appear is critical.

    I used the await approach to get the effect that I wanted. But the thing is that I will have to click on the first tab's button in order to get the rest of tabs to render and be clickable. I really want them to be rendered together, that way the user can choose which tab to click.

    with ui.tab_panels(tabs=tabs, value=cleanup_data).classes('w-full'):
    with ui.tab_panel(cleanup_data):
    ui.label('lorem').set_visibility(False)
    a = ui.button('help?', on_click=test)
    await a.clicked()
    ui.label('lorem').set_visibility(True)
    with ui.tab_panel(change_data):
    ui.label('lorem').set_visibility(False)
    b = ui.button('help?', on_click=test)
    await b.clicked()
    ui.label('lorem').set_visibility(True)
    with ui.tab_panel(move_data):
    ui.label('lorem').set_visibility(False)
    c = ui.button('help?', on_click=test)
    await c.clicked()
    ui.label('lorem').set_visibility(True)


    the image is what I currently get

    Continue reading...

Compartilhe esta Página