SpectAcoular documentation

spectacoular.factory.set_widgets

«  spectacoular.factory.get_widgets   ::   factory   ::   BaseSpectacoular  »

spectacoular.factory.set_widgets

spectacoular.factory.set_widgets(self, **kwargs)

Set instances of Bokeh widgets to certain trait attributes

This function is implemented in all SpectAcoular classes and is added to Acoular’s classes in bokehview.py. It allows to reference an existing widget to a certain class trait attribute. Expects a class traits name as parameter and the widget instance as value.

For example:
>>> from spectacoular import RectGrid
>>> from bokeh.models.widgets import Select
>>>
>>> rg = RectGrid()
>>> sl = Select(value="10.0")
>>> rg.set_widgets(x_max=sl)

The value of the trait attribute changes to the widgets value when it is different.

Parameters:
**kwargs

The name of the class trait attributes. Depends on the class.

Returns:
None.

«  spectacoular.factory.get_widgets   ::   factory   ::   BaseSpectacoular  »