+ parent.subscribe(AVERAGE_KEY, widget.ShowItems)
+ #allways show initially, so room is reserved for them
+ widget.ShowItems(True) # (parent[AVERAGE_KEY])
+
+ parent.subscribe(AVERAGE_KEY, self._update_layout)
+
+ forms.check_box(
+ sizer=options_box, parent=self, label='Emulate Analog',
+ ps=parent, key=EMULATE_ANALOG_KEY,
+ )
+ #static text and slider for analog alpha
+ analog_alpha_text = forms.static_text(
+ sizer=options_box, parent=self, label='Analog Alpha',
+ converter=forms.float_converter(lambda x: '%.4f'%x),
+ ps=parent, key=ANALOG_ALPHA_KEY, width=50,
+ )
+ analog_alpha_slider = forms.log_slider(
+ sizer=options_box, parent=self,
+ min_exp=ANALOG_ALPHA_MIN_EXP,
+ max_exp=ANALOG_ALPHA_MAX_EXP,
+ num_steps=SLIDER_STEPS,
+ ps=parent, key=ANALOG_ALPHA_KEY,
+ )
+ for widget in (analog_alpha_text, analog_alpha_slider):
+ parent.subscribe(EMULATE_ANALOG_KEY, widget.Enable)
+ widget.Enable(parent[EMULATE_ANALOG_KEY])
+ parent.subscribe(EMULATE_ANALOG_KEY, widget.ShowItems)
+ #allways show initially, so room is reserved for them
+ widget.ShowItems(True) # (parent[EMULATE_ANALOG_KEY])