okay... lets say in the above example you want the subcontext menu items 1 - 10. Is it possible to do something like...

for $button = 1 to 10
CreateButton
next

Also, if the above is possible, how would you know what button is pressed?