我尝试在GUI中链接两个常用控件,一个滑块和一个SpinBox。它们来自Blackmagic Fusion
软件的Python库。碰巧,以我尝试的方式,它似乎正在用SpinBox值覆盖滑块控件
下面是这两个项目的可用事件
滑块: 值已更改, 滑块移动, 动作触发, 滑块压缩, 滑块释放, 范围改变了
微调框: 编辑完成, 值已更改
# GUI
dlg = disp.AddWindow({'ID': 'myWin', 'WindowTitle': 'myWin', 'Geometry': [ 400, 100, 230, 400 ],},
[
ui.Slider({ 'ID': 'mySlider', 'Events': { 'SliderMoved': True, 'Activated': True } }),
ui.SpinBox({ 'ID': 'mySpinBox' }),
])
itm = dlg.GetItems()
# Updates the Spin value when moves the Slider
def _func(ev):
var = ev['Value']
itm['mySpinBox'].Value = var
dlg.On.mySlider.SliderMoved = _func
# Updates thed Slider position when SpinBox value is changed
def _func(ev):
itm['mySlider'].Value = itm['mySpinBox'].Value
dlg.On.mySpinBox.ValueChanged = _func
目前没有回答
相关问题 更多 >
编程相关推荐