You can use the add item to action bar statement to add pull-downs and buttons dynamically to any region's action bar. The pull-down or button must be defined globally, either at compile time or by adding it at runtime. Once the item definition exists, it can be used to create a new item in the action bar of a region or class of regions.
The before and after keywords are used to position the new pull-down or button as desired. before positions the new item to the left of the existing item, while after positions the new item to the right of the existing item.
The following example dynamically adds a Quit button to the MainMenu action bar defined earlier.
add button QuitButton text "F3 = Quit"
accelerator is KEY_F3
add item QuitButton to action bar in Region
before item HelpButton
Note that QuitButton is added only to the action bar in a single region or class of regions. The action bar template MainMenu, which was used to create the action bar in Region, does not change.