Panda3D Manual: DirectOptionMenu
  <<prev top next>>  

The DirectOptionMenu class models a popup menu with an arbitrary number of items. It is composed of the menu bar, the popup marker, and the popup menu itself. The popup menu appears when the menu is clicked on and disappears when the user clicks again; if the click was inside the popup, the selection changes. By default, the text on the menu changes to whatever item is currently selected. The attributes that affect the appearance of the menu bar don't apply to the popup. Make sure to specify the items option or it may crash.


KeywordDefinitionValue
textMayChangeWhether the text on the menu changes with the selection0 or 1
initialitemThe index of the item that appears next to the cursor when the popup appearsNumber
itemsList of items in the popup menu[Strings]
commandFunction called when an item is selected (the item is passed in as a parameter)Function
commandButtonsWhich mouse button must be clicked to open the popupLMB, MMB, or RMB
extraArgsExtra arguments to the function specified in command[Extra Arguments]
highlightColorColor of highlighted text(R,G,B,A)
rolloverSoundThe sound made when the cursor rolls over the buttonSound File Path
clickSoundThe sound made when the cursor clicks on the buttonSound File Path
popupMarkerBorderUse width to change the size of the border around the popup marker(Width,Height)
  <<prev top next>>