☰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

On_Click vs On_Event

Community Support
Mark_Murphy
Mark_Murphy

I’m looking to use SelectionGeometry to try to capture the data the user selects in a plot. I want to allow multiple selections with shift so I plan on selecting the data, then using a button to trigger processing of the selected data with python script.

Can anyone describe the difference between using on_event or on_click?
button.on_event(ButtonClick, callback) vs button.on_click(callback)

Is one preferable over another?

⌁   Link to post
Bryan
Bryan

There is no difference, on_click does nothing but set up an event handler for the ButtonClick event:

    def on_click(self, handler):
        self.on_event(ButtonClick, handler)

it’s just there as a convenience and for historical compatibility.

⌁   Link to post

End of archived discussion · Replies are disabled