对于以下代码:
def foo(attr, old, new):
print "Replacing value %s with %s" % (old, new)
selector = RadioButtonGroup(labels=["a", "b"], active=0)
selector.on_change("active", foo)
之后删除回调的正确方法是什么(即从选择器中分离foo?)
答案 0 :(得分:0)
每个模型都有remove_on_change
方法:
def foo(attr, old, new):
...
selector.remove_on_change('active', foo)