Skip to content

Set widget attribute in on_connect handler #3887

Closed Answered by rodja
xaptronic asked this question in Q&A
Discussion options

You must be logged in to vote

There are quite a few bugs in your code. Try

def on_client_connect():
    with ui.context.client:
        my_widget.text = "Welcome!"

my_widget = ui.label("Initial Value")

app.on_connect(on_client_connect)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@xaptronic
Comment options

Answer selected by xaptronic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants