osscar-org / scicode-widgets

A collection of widgets to prepare interactive scientific visualisations, including user code input and validation
https://osscar-org.github.io/scicode-widgets/
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Traits are not linked to widget view with widget_code_input 4 #53

Closed agoscinski closed 4 months ago

agoscinski commented 4 months ago

Problem

when running two cells

from scwidgets.code import CodeInput
def foo():
    return 'init'
ci = CodeInput(foo)
ci
ci.function_body = """return 'change'"""

the widget view is not updated on the change of the function_body.

Fix

Because with widget 4 the code themes names have changed, the wrong default theme default is not valid anymore and causes this bug. We need to update the default code_theme name.