Optionmenu Arrow Arrow As Control?

Hello I'm new to the forums.

I am trying to make the contents of an optionMenu dynamicly updateable, I have an OptionMenu dropdown list (which is of cameras in the scene) which can update with the names of new cameras and remove items when cameras are deleted...

The procedure which does the refreshing is activated via scripjob when any scene object is deleted or created.

Ideally I would like to activate this scriptjob only when the dropdown OptionMenu list is activated - on a mouseclick over the little down arrow to the right of the list.

Is it at all possible to use this arrow as a control directly?

i think u can use script job

maye be selection change or attr change you can call a proc

that will re-load the cam list in option menu..

or maybe in change command of option menu also you can all the proc

but i dont think so you can call a proc while cliking the drop down

No, this is not possible.

You might want to consider replacing the optionMenu with a simple textField to which you attach a popupMenu to pop up on -button 1 with the -postMenuCommand set to a function which populates the contents of the $m=popupMenu with menuItems -parent $m ... on the fly.

This gives you the opportunity to query your scene for cameras and build the menu before it pops up, so you can delete your scriptJob entirely.

It even feels better that an optionMenu. But is quite a bit of work. after selecting the menuItem you place the camera name in the textField.

word! Thats just what I wanted to suggest as I read the post :]

But I can append that you can add this popupMenu to every control-element. You could even assemble something that looks like an option menu. But I prefer buttons or symbolbuttons for such stuff.

Thanks for the quick replys!