I need to create a callback to a fucntion that use use the value of the widget that call the function.
my_sbox=st.selectbox("MysBox", options=["first","second"],key="s_box", on_change=myfunc())
myfunc():
print(my_sbox)
It does not work because the function is not defined before creating the widget, and if I exchange position of the function and of the widget, when the callback is called, then the widget is not yet created.
Any idea if I can solve this?