I think an example in here would be fitting, I’m not aware of how to do this properly.
I suspect it’s similar to how Python programs do it but I’m not that well versed in that aspect of Python
I think an example in here would be fitting, I’m not aware of how to do this properly.
I suspect it’s similar to how Python programs do it but I’m not that well versed in that aspect of Python
Figured out how to do it on my end, but still think it should be added to docs.
My code that worked:
def callback(lat, long):
st.session_state.gps_latitude = lat
st.session_state.gps_longitude = long
st.sidebar.button(f"Set GPS to {target_obj.latitude}, {target_obj.longitude}",
key=random.random(), on_click=callback, args=[target_obj.latitude,target_obj.longitude])