How can I consolidate a bunch of similar ui_control callbacks?

Alcot60890
Alcot60890 Member Posts: 17 Member
on ui_control($options_001)
  $GroupPage := 1
  hide_part($VolSlider_001,$HIDE_PART_NOTHING)
  hide_part($VolSlider_002,$HIDE_WHOLE_CONTROL)
  hide_part($VolSlider_003,$HIDE_WHOLE_CONTROL)
  hide_part($VolSlider_004,$HIDE_WHOLE_CONTROL)
end on
on ui_control($options_002)
  $GroupPage :=2
  hide_part($VolSlider_001,$HIDE_WHOLE_CONTROL)
  hide_part($VolSlider_002,$HIDE_PART_NOTHING)
  hide_part($VolSlider_003,$HIDE_WHOLE_CONTROL)
  hide_part($VolSlider_004,$HIDE_WHOLE_CONTROL)
end on
on ui_control($options_003)
  $GroupPage :=3
  hide_part($VolSlider_001,$HIDE_WHOLE_CONTROL)
  hide_part($VolSlider_002,$HIDE_WHOLE_CONTROL)
  hide_part($VolSlider_003,$HIDE_PART_NOTHING)
  hide_part($VolSlider_004,$HIDE_WHOLE_CONTROL)
end on
on ui_control($options_004)
  $GroupPage :=4
  hide_part($VolSlider_001,$HIDE_WHOLE_CONTROL)
  hide_part($VolSlider_002,$HIDE_WHOLE_CONTROL)
  hide_part($VolSlider_003,$HIDE_PART_NOTHING)
  hide_part($VolSlider_004,$HIDE_WHOLE_CONTROL)

end on

Hi, I have a many enumerated ui_control callbacks formatted like this example, which I'd like to consolidate as much as possible. How might I approach this? I would expect I could use a While loop and get_ui_id to increment the IDs of the widgets, but I can't seem to make that work in the callback or the hide_part. Thanks in advance for any advice or examples. :)

Comments

Back To Top