☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Get widget by name via python (not javascript-CustomJS)

Community Support
ThemisKoutsellis
ThemisKoutsellis

I would like to link two (or more) widget values. That is, if the user interacts with a given widget, I would like to change accordingly the value of another widget (or disable that widget). I guess this could be done via the property “name”. However, I would like to do so via a python callback (not javascript code). Is that possible?

=============

def foo_callback(attr, old, new):
???
return ?

foo_spinner = Spinner(
title=“Foo spinner”,
low=1, high=100,
step=1, value=1, width=300,
)
foo_spinner.on_change(‘value’, foo_callback)

foo_check_box = CheckboxGroup(labels=‘I am a happy check box’, active=)

===================
Say, I want to deactivate foo_spinner when the foo_check_box is not active (not selected). I would also like to set the value of foo_spinner equal to 30 when foo_check_box is activated (selected by the user)
Any suggestion?

Thank you in advance!

Themis

⌁   Link to post
Bryan
Bryan

Then you don’t need to do anything. Just define the widgets before any callback functions, then you can access (and thus manipulate) the widgets inside the callbacks per standard python scoping rules.

⌁   Link to post

End of archived discussion · Replies are disabled