Breaking/binding a dropdown menu out to a perform UI

Hi there! I am building a UI with widgets in a container to serve as a control panel in perform mode. I’d like the end user to be able to make two selections - the display source for a screengrab TOP, and the Drive/Device for an Audio Device Out CHOP.

So, essentially I want to know how to bind a menu parameter like op(“myscreengrab”).par.source or op(“myaudioout”).par.device to one of the drop down menu widgets like dropDownMenu from the Ui/Basic Widgets palette.

Is there a simple way? Right now I’ve put a chopexec looking at the out_menu0Index inside dropDownMenu, which sets the parameter when the UI dropdown is changed. I’m using the “Command On Click” field of the dropDownMenu Widget to run a script to populate the menuName and menuLabels of the ui DropDownMenu with all the options in the menu params in the screengrab or audio chop. I do this since, in either case, there could be new window sources to choose from or new audio devices, so I want to refresh the list each time the user tries to choose. But, I’m noticing this script doesn’t seem to run before the menu is displayed, so you have to click the menu twice to truly get a refreshed list. Feels unreliable.

Is there a simpler (or more reliable version of my current complicated solution) to make a binding kind of bidirectional link between a menu parameter and a ui dropDownMenu?

Ok, just randomly trying stuff. Driving menuNames and menuLabels with Python expressions trying to pull from op(“myscreengrab”).par.source.menuItems didn’t work, I think maybe because there is nothing pulling on the widget’s labels or names string parameters.

So, I’ve tried making a parameter DAT. Pointed it at myscreengrab’s source parameter, and turned on output built in and menu names / menu labels. I see the menu names and menu labels show up in the DAT table. I put a DAT execute monitoring change on that parameter DAT, which sets my dropDownMenu widget’s menuNames/Labels params.

I assumed:
– User pulses screengrab’s “Refresh Sources” button
– That updates the screengrab’s source param’s menuLabels and menuNames. I can tell these change by opening/closing a test window, and pulsing Refresh Sources, then checking screengrab’s source dropdown myself)
– The param DAT would notice that the param it’s monitoring, source, (and it’s menuLabels and menuNames attributes) has changed, and update its table
– My DAT execute would see that change, pull the new names/labels from the table and set them on my widget

Unfortunately, when I pulse the refresh source button on the screengrab, the source param dropdown on screengrab gets new items, but my execute DAT is never firing (I have table change, cell change on), indicating to me the parameter DAT is not noticing that screengrabs source param’s menuName and menuLabels changed.

Phew.

Am I expecting the parameter DAT to behave a way it’s not supposed to? Is there a better way to go about this?

OK - at this point, think I’d love to even just see an example of someone using a dropdown menu properly. I’m getting inconsistent results when trying to refer to an options table, with the results of the on click command not executing before the menu is displayed, and with plugging a DAT into the drop down input.

Hi @mtf

Is this the kind of thing you’re looking for:
container_dropdown.tox (63.0 KB)

These can be a bit tricksy, as you likely want to capture names and labels for the widget:

But then want to bind the parameter to keep the ops sycned:

1 Like

It’s really close! What I’m struggling with is the refreshing - try opening a new window on your computer, like notepad or some other app. You then have to click (or pulse) refresh sources on the screengrab to update its drop down list of sources.

For some reason, the names and labels parameters on the (non screengrab) dropdown widget don’t update for me. It’s almost as if they don’t notice the expressions should pull the new labels and names from screengrab…

That’s what led me down the path of trying to use a parameter DAT to monitor the sources param, and maybe update labels/names if it changed

Sorry for the bump. I’m trying to get this wrapped up, so even looking for a suggestion on a hack.

I’m tempted to do something awful like use an execute DAT to update menuLabels and menuNames on my UI dropdown at frame start, especially because the UI panel for this task is not up all the time and I can not run the update when it’s not visible.

But, would really like to understand better if this is a bug or I’m misunderstanding something.

Hey,

This is a bug. The menuNames and menuLabels members are changing so they should be dependable and therefore the widget menu and labels should update. I will add this to our bug database.

We just released a new bulid so might be a few weeks before there is a fix. Here is a the dropDownMenu widget wrapped in an extension component that allows you to specify the parameter to watch and you can bind the Update pulse button to whatever event you like - for example the pulse of the screengrab update button.

MenuWatcher.toe (25.5 KB)

1 Like

Fantastic. Thanks for getting back so quickly. Glad to have that bug on the books, and this work around is perfect for the time being. Thanks on both counts! All good here.