I want to create a custom bokeh widget without using JavaScript, i.e. without following the bokeh documentation on Adding A Custom Widget. The example below demonstrates the creation of a custom widget in PyQt4 (I use this a lot), and what I would expect to work in bokeh along with the error message I get.
Is there some other way to create a custom widget in bokeh without using JavaScript? Specifically I am trying to create a custom slider with small - and + buttons on each side that increment / decrement the slider by 1 step. I want to use this custom widget in many applications so I want it defined as its own class with on_change method linked to the slider on_change method. There are other custom widgets in bokeh I want to make (without JS!) and I would like to know if this is even possible.
# this works as a base to develop custom PyQt4 widgets
from PyQt4 import QtGui
import sys
class NewWidget(QtGui.QWidget):
def __init__(self):
super().__init__()
app = QtGui.QApplication([])
widget = NewWidget()
widget.show()
sys.exit(app.exec_())
# this does not work as a base to develop custom bokeh widgets
# when run, a tab opens with the message
# Bokeh Error
# Model `NewWidget' does not exist. This could be due to a widget
# or a custom model not being registered before first usage.
from bokeh.plotting import show
from bokeh.layouts import widgetbox
from bokeh.models.widgets import Widget
class NewWidget(Widget):
def __init__(self):
super().__init__()
new = NewWidget()
show(widgetbox(new))
UPDATE: The specific custom widget I am attempting to create is a Slider with a Button on each side (on the left labeled '-', on the right labeled '+') that change the Slider value by 1 step. This is used to fine-tune the value of a Slider so the mouse is not required to exactly hit a target value. I created this custom widget by linking default Slider and Button objects and it renders in the browser, but the callback functionality is not working (specifically the Slider 'on_change' method).
Is this custom widget straightforward to implement with bokeh and JS? Is there an online reference that may provide hints without diving too deep into JS.

.on_changerequires a Bokeh server (that's where the python callback gets executed) Are you saying this does not work with a server app? Or is this not in the context of a server app? In any case it seems like this should be do-able more generally with a line or two of JS and.js_on_changecallback: bokeh.pydata.org/en/latest/docs/user_guide/interaction/… which does not require a servercallbackproperty to set aCustomJScallback. See below