class_popupmenu.rst 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the PopupMenu.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_PopupMenu:
  6. PopupMenu
  7. =========
  8. **Inherits:** :ref:`Popup<class_Popup>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. PopupMenu displays a list of options.
  10. Description
  11. -----------
  12. ``PopupMenu`` is a :ref:`Control<class_Control>` that displays a list of options. They are popular in toolbars or context menus.
  13. Properties
  14. ----------
  15. +------------------------------------------+----------------------------------------------------------------------------------------------------+--------------+
  16. | :ref:`bool<class_bool>` | :ref:`allow_search<class_PopupMenu_property_allow_search>` | ``false`` |
  17. +------------------------------------------+----------------------------------------------------------------------------------------------------+--------------+
  18. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | **O:** ``2`` |
  19. +------------------------------------------+----------------------------------------------------------------------------------------------------+--------------+
  20. | :ref:`bool<class_bool>` | :ref:`hide_on_checkable_item_selection<class_PopupMenu_property_hide_on_checkable_item_selection>` | ``true`` |
  21. +------------------------------------------+----------------------------------------------------------------------------------------------------+--------------+
  22. | :ref:`bool<class_bool>` | :ref:`hide_on_item_selection<class_PopupMenu_property_hide_on_item_selection>` | ``true`` |
  23. +------------------------------------------+----------------------------------------------------------------------------------------------------+--------------+
  24. | :ref:`bool<class_bool>` | :ref:`hide_on_state_item_selection<class_PopupMenu_property_hide_on_state_item_selection>` | ``false`` |
  25. +------------------------------------------+----------------------------------------------------------------------------------------------------+--------------+
  26. | :ref:`float<class_float>` | :ref:`submenu_popup_delay<class_PopupMenu_property_submenu_popup_delay>` | ``0.3`` |
  27. +------------------------------------------+----------------------------------------------------------------------------------------------------+--------------+
  28. Methods
  29. -------
  30. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`add_check_item<class_PopupMenu_method_add_check_item>` **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)** |
  32. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`add_check_shortcut<class_PopupMenu_method_add_check_shortcut>` **(** :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)** |
  34. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`add_icon_check_item<class_PopupMenu_method_add_icon_check_item>` **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)** |
  36. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`add_icon_check_shortcut<class_PopupMenu_method_add_icon_check_shortcut>` **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)** |
  38. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`add_icon_item<class_PopupMenu_method_add_icon_item>` **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)** |
  40. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`add_icon_radio_check_item<class_PopupMenu_method_add_icon_radio_check_item>` **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)** |
  42. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`add_icon_radio_check_shortcut<class_PopupMenu_method_add_icon_radio_check_shortcut>` **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)** |
  44. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`add_icon_shortcut<class_PopupMenu_method_add_icon_shortcut>` **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)** |
  46. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`add_item<class_PopupMenu_method_add_item>` **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)** |
  48. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`add_multistate_item<class_PopupMenu_method_add_multistate_item>` **(** :ref:`String<class_String>` label, :ref:`int<class_int>` max_states, :ref:`int<class_int>` default_state=0, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)** |
  50. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`add_radio_check_item<class_PopupMenu_method_add_radio_check_item>` **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)** |
  52. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`add_radio_check_shortcut<class_PopupMenu_method_add_radio_check_shortcut>` **(** :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)** |
  54. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`add_separator<class_PopupMenu_method_add_separator>` **(** :ref:`String<class_String>` label="" **)** |
  56. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`add_shortcut<class_PopupMenu_method_add_shortcut>` **(** :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)** |
  58. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`add_submenu_item<class_PopupMenu_method_add_submenu_item>` **(** :ref:`String<class_String>` label, :ref:`String<class_String>` submenu, :ref:`int<class_int>` id=-1 **)** |
  60. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | void | :ref:`clear<class_PopupMenu_method_clear>` **(** **)** |
  62. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`int<class_int>` | :ref:`get_item_accelerator<class_PopupMenu_method_get_item_accelerator>` **(** :ref:`int<class_int>` idx **)** const |
  64. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`int<class_int>` | :ref:`get_item_count<class_PopupMenu_method_get_item_count>` **(** **)** const |
  66. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_item_icon<class_PopupMenu_method_get_item_icon>` **(** :ref:`int<class_int>` idx **)** const |
  68. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`int<class_int>` | :ref:`get_item_id<class_PopupMenu_method_get_item_id>` **(** :ref:`int<class_int>` idx **)** const |
  70. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`int<class_int>` | :ref:`get_item_index<class_PopupMenu_method_get_item_index>` **(** :ref:`int<class_int>` id **)** const |
  72. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`Variant<class_Variant>` | :ref:`get_item_metadata<class_PopupMenu_method_get_item_metadata>` **(** :ref:`int<class_int>` idx **)** const |
  74. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`ShortCut<class_ShortCut>` | :ref:`get_item_shortcut<class_PopupMenu_method_get_item_shortcut>` **(** :ref:`int<class_int>` idx **)** const |
  76. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`String<class_String>` | :ref:`get_item_submenu<class_PopupMenu_method_get_item_submenu>` **(** :ref:`int<class_int>` idx **)** const |
  78. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`String<class_String>` | :ref:`get_item_text<class_PopupMenu_method_get_item_text>` **(** :ref:`int<class_int>` idx **)** const |
  80. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`String<class_String>` | :ref:`get_item_tooltip<class_PopupMenu_method_get_item_tooltip>` **(** :ref:`int<class_int>` idx **)** const |
  82. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`bool<class_bool>` | :ref:`is_hide_on_window_lose_focus<class_PopupMenu_method_is_hide_on_window_lose_focus>` **(** **)** const |
  84. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`bool<class_bool>` | :ref:`is_item_checkable<class_PopupMenu_method_is_item_checkable>` **(** :ref:`int<class_int>` idx **)** const |
  86. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`bool<class_bool>` | :ref:`is_item_checked<class_PopupMenu_method_is_item_checked>` **(** :ref:`int<class_int>` idx **)** const |
  88. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`bool<class_bool>` | :ref:`is_item_disabled<class_PopupMenu_method_is_item_disabled>` **(** :ref:`int<class_int>` idx **)** const |
  90. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`bool<class_bool>` | :ref:`is_item_radio_checkable<class_PopupMenu_method_is_item_radio_checkable>` **(** :ref:`int<class_int>` idx **)** const |
  92. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`bool<class_bool>` | :ref:`is_item_separator<class_PopupMenu_method_is_item_separator>` **(** :ref:`int<class_int>` idx **)** const |
  94. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`bool<class_bool>` | :ref:`is_item_shortcut_disabled<class_PopupMenu_method_is_item_shortcut_disabled>` **(** :ref:`int<class_int>` idx **)** const |
  96. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`remove_item<class_PopupMenu_method_remove_item>` **(** :ref:`int<class_int>` idx **)** |
  98. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`set_hide_on_window_lose_focus<class_PopupMenu_method_set_hide_on_window_lose_focus>` **(** :ref:`bool<class_bool>` enable **)** |
  100. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`set_item_accelerator<class_PopupMenu_method_set_item_accelerator>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` accel **)** |
  102. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`set_item_as_checkable<class_PopupMenu_method_set_item_as_checkable>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)** |
  104. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | void | :ref:`set_item_as_radio_checkable<class_PopupMenu_method_set_item_as_radio_checkable>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)** |
  106. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | void | :ref:`set_item_as_separator<class_PopupMenu_method_set_item_as_separator>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)** |
  108. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`set_item_checked<class_PopupMenu_method_set_item_checked>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)** |
  110. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | void | :ref:`set_item_disabled<class_PopupMenu_method_set_item_disabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  112. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`set_item_icon<class_PopupMenu_method_set_item_icon>` **(** :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)** |
  114. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`set_item_id<class_PopupMenu_method_set_item_id>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)** |
  116. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`set_item_metadata<class_PopupMenu_method_set_item_metadata>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)** |
  118. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`set_item_multistate<class_PopupMenu_method_set_item_multistate>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)** |
  120. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`set_item_shortcut<class_PopupMenu_method_set_item_shortcut>` **(** :ref:`int<class_int>` idx, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`bool<class_bool>` global=false **)** |
  122. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | void | :ref:`set_item_shortcut_disabled<class_PopupMenu_method_set_item_shortcut_disabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  124. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`set_item_submenu<class_PopupMenu_method_set_item_submenu>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)** |
  126. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | void | :ref:`set_item_text<class_PopupMenu_method_set_item_text>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)** |
  128. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | void | :ref:`set_item_tooltip<class_PopupMenu_method_set_item_tooltip>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)** |
  130. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`toggle_item_checked<class_PopupMenu_method_toggle_item_checked>` **(** :ref:`int<class_int>` idx **)** |
  132. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`toggle_item_multistate<class_PopupMenu_method_toggle_item_multistate>` **(** :ref:`int<class_int>` idx **)** |
  134. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. Theme Properties
  136. ----------------
  137. +-----------------------------------+-------------------------+------------------------------+
  138. | :ref:`Texture2D<class_Texture2D>` | checked | |
  139. +-----------------------------------+-------------------------+------------------------------+
  140. | :ref:`Font<class_Font>` | font | |
  141. +-----------------------------------+-------------------------+------------------------------+
  142. | :ref:`Color<class_Color>` | font_color | Color( 0.88, 0.88, 0.88, 1 ) |
  143. +-----------------------------------+-------------------------+------------------------------+
  144. | :ref:`Color<class_Color>` | font_color_accel | Color( 0.7, 0.7, 0.7, 0.8 ) |
  145. +-----------------------------------+-------------------------+------------------------------+
  146. | :ref:`Color<class_Color>` | font_color_disabled | Color( 0.4, 0.4, 0.4, 0.8 ) |
  147. +-----------------------------------+-------------------------+------------------------------+
  148. | :ref:`Color<class_Color>` | font_color_hover | Color( 0.88, 0.88, 0.88, 1 ) |
  149. +-----------------------------------+-------------------------+------------------------------+
  150. | :ref:`StyleBox<class_StyleBox>` | hover | |
  151. +-----------------------------------+-------------------------+------------------------------+
  152. | :ref:`int<class_int>` | hseparation | 4 |
  153. +-----------------------------------+-------------------------+------------------------------+
  154. | :ref:`StyleBox<class_StyleBox>` | labeled_separator_left | |
  155. +-----------------------------------+-------------------------+------------------------------+
  156. | :ref:`StyleBox<class_StyleBox>` | labeled_separator_right | |
  157. +-----------------------------------+-------------------------+------------------------------+
  158. | :ref:`StyleBox<class_StyleBox>` | panel | |
  159. +-----------------------------------+-------------------------+------------------------------+
  160. | :ref:`StyleBox<class_StyleBox>` | panel_disabled | |
  161. +-----------------------------------+-------------------------+------------------------------+
  162. | :ref:`Texture2D<class_Texture2D>` | radio_checked | |
  163. +-----------------------------------+-------------------------+------------------------------+
  164. | :ref:`Texture2D<class_Texture2D>` | radio_unchecked | |
  165. +-----------------------------------+-------------------------+------------------------------+
  166. | :ref:`StyleBox<class_StyleBox>` | separator | |
  167. +-----------------------------------+-------------------------+------------------------------+
  168. | :ref:`Texture2D<class_Texture2D>` | submenu | |
  169. +-----------------------------------+-------------------------+------------------------------+
  170. | :ref:`Texture2D<class_Texture2D>` | unchecked | |
  171. +-----------------------------------+-------------------------+------------------------------+
  172. | :ref:`int<class_int>` | vseparation | 4 |
  173. +-----------------------------------+-------------------------+------------------------------+
  174. Signals
  175. -------
  176. .. _class_PopupMenu_signal_id_focused:
  177. - **id_focused** **(** :ref:`int<class_int>` id **)**
  178. Emitted when user navigated to an item of some ``id`` using ``ui_up`` or ``ui_down`` action.
  179. ----
  180. .. _class_PopupMenu_signal_id_pressed:
  181. - **id_pressed** **(** :ref:`int<class_int>` id **)**
  182. Emitted when an item of some ``id`` is pressed or its accelerator is activated.
  183. ----
  184. .. _class_PopupMenu_signal_index_pressed:
  185. - **index_pressed** **(** :ref:`int<class_int>` index **)**
  186. Emitted when an item of some ``index`` is pressed or its accelerator is activated.
  187. Property Descriptions
  188. ---------------------
  189. .. _class_PopupMenu_property_allow_search:
  190. - :ref:`bool<class_bool>` **allow_search**
  191. +-----------+-------------------------+
  192. | *Default* | ``false`` |
  193. +-----------+-------------------------+
  194. | *Setter* | set_allow_search(value) |
  195. +-----------+-------------------------+
  196. | *Getter* | get_allow_search() |
  197. +-----------+-------------------------+
  198. If ``true``, allows to navigate ``PopupMenu`` with letter keys.
  199. ----
  200. .. _class_PopupMenu_property_hide_on_checkable_item_selection:
  201. - :ref:`bool<class_bool>` **hide_on_checkable_item_selection**
  202. +-----------+---------------------------------------------+
  203. | *Default* | ``true`` |
  204. +-----------+---------------------------------------------+
  205. | *Setter* | set_hide_on_checkable_item_selection(value) |
  206. +-----------+---------------------------------------------+
  207. | *Getter* | is_hide_on_checkable_item_selection() |
  208. +-----------+---------------------------------------------+
  209. If ``true``, hides the ``PopupMenu`` when a checkbox or radio button is selected.
  210. ----
  211. .. _class_PopupMenu_property_hide_on_item_selection:
  212. - :ref:`bool<class_bool>` **hide_on_item_selection**
  213. +-----------+-----------------------------------+
  214. | *Default* | ``true`` |
  215. +-----------+-----------------------------------+
  216. | *Setter* | set_hide_on_item_selection(value) |
  217. +-----------+-----------------------------------+
  218. | *Getter* | is_hide_on_item_selection() |
  219. +-----------+-----------------------------------+
  220. If ``true``, hides the ``PopupMenu`` when an item is selected.
  221. ----
  222. .. _class_PopupMenu_property_hide_on_state_item_selection:
  223. - :ref:`bool<class_bool>` **hide_on_state_item_selection**
  224. +-----------+-----------------------------------------+
  225. | *Default* | ``false`` |
  226. +-----------+-----------------------------------------+
  227. | *Setter* | set_hide_on_state_item_selection(value) |
  228. +-----------+-----------------------------------------+
  229. | *Getter* | is_hide_on_state_item_selection() |
  230. +-----------+-----------------------------------------+
  231. If ``true``, hides the ``PopupMenu`` when a state item is selected.
  232. ----
  233. .. _class_PopupMenu_property_submenu_popup_delay:
  234. - :ref:`float<class_float>` **submenu_popup_delay**
  235. +-----------+--------------------------------+
  236. | *Default* | ``0.3`` |
  237. +-----------+--------------------------------+
  238. | *Setter* | set_submenu_popup_delay(value) |
  239. +-----------+--------------------------------+
  240. | *Getter* | get_submenu_popup_delay() |
  241. +-----------+--------------------------------+
  242. Sets the delay time in seconds for the submenu item to popup on mouse hovering. If the popup menu is added as a child of another (acting as a submenu), it will inherit the delay time of the parent menu item.
  243. Method Descriptions
  244. -------------------
  245. .. _class_PopupMenu_method_add_check_item:
  246. - void **add_check_item** **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  247. Adds a new checkable item with text ``label``.
  248. An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator<class_PopupMenu_method_get_item_accelerator>` for more info on accelerators.
  249. **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked<class_PopupMenu_method_set_item_checked>` for more info on how to control it.
  250. ----
  251. .. _class_PopupMenu_method_add_check_shortcut:
  252. - void **add_check_shortcut** **(** :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  253. Adds a new checkable item and assigns the specified :ref:`ShortCut<class_ShortCut>` to it. Sets the label of the checkbox to the :ref:`ShortCut<class_ShortCut>`'s name.
  254. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  255. **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked<class_PopupMenu_method_set_item_checked>` for more info on how to control it.
  256. ----
  257. .. _class_PopupMenu_method_add_icon_check_item:
  258. - void **add_icon_check_item** **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  259. Adds a new checkable item with text ``label`` and icon ``texture``.
  260. An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator<class_PopupMenu_method_get_item_accelerator>` for more info on accelerators.
  261. **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked<class_PopupMenu_method_set_item_checked>` for more info on how to control it.
  262. ----
  263. .. _class_PopupMenu_method_add_icon_check_shortcut:
  264. - void **add_icon_check_shortcut** **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  265. Adds a new checkable item and assigns the specified :ref:`ShortCut<class_ShortCut>` and icon ``texture`` to it. Sets the label of the checkbox to the :ref:`ShortCut<class_ShortCut>`'s name.
  266. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  267. **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked<class_PopupMenu_method_set_item_checked>` for more info on how to control it.
  268. ----
  269. .. _class_PopupMenu_method_add_icon_item:
  270. - void **add_icon_item** **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  271. Adds a new item with text ``label`` and icon ``texture``.
  272. An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator<class_PopupMenu_method_get_item_accelerator>` for more info on accelerators.
  273. ----
  274. .. _class_PopupMenu_method_add_icon_radio_check_item:
  275. - void **add_icon_radio_check_item** **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  276. Same as :ref:`add_icon_check_item<class_PopupMenu_method_add_icon_check_item>`, but uses a radio check button.
  277. ----
  278. .. _class_PopupMenu_method_add_icon_radio_check_shortcut:
  279. - void **add_icon_radio_check_shortcut** **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  280. Same as :ref:`add_icon_check_shortcut<class_PopupMenu_method_add_icon_check_shortcut>`, but uses a radio check button.
  281. ----
  282. .. _class_PopupMenu_method_add_icon_shortcut:
  283. - void **add_icon_shortcut** **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  284. Adds a new item and assigns the specified :ref:`ShortCut<class_ShortCut>` and icon ``texture`` to it. Sets the label of the checkbox to the :ref:`ShortCut<class_ShortCut>`'s name.
  285. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  286. ----
  287. .. _class_PopupMenu_method_add_item:
  288. - void **add_item** **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  289. Adds a new item with text ``label``.
  290. An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator<class_PopupMenu_method_get_item_accelerator>` for more info on accelerators.
  291. ----
  292. .. _class_PopupMenu_method_add_multistate_item:
  293. - void **add_multistate_item** **(** :ref:`String<class_String>` label, :ref:`int<class_int>` max_states, :ref:`int<class_int>` default_state=0, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  294. Adds a new multistate item with text ``label``.
  295. Contrarily to normal binary items, multistate items can have more than two states, as defined by ``max_states``. Each press or activate of the item will increase the state by one. The default value is defined by ``default_state``.
  296. An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator<class_PopupMenu_method_get_item_accelerator>` for more info on accelerators.
  297. ----
  298. .. _class_PopupMenu_method_add_radio_check_item:
  299. - void **add_radio_check_item** **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  300. Adds a new radio check button with text ``label``.
  301. An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator<class_PopupMenu_method_get_item_accelerator>` for more info on accelerators.
  302. **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked<class_PopupMenu_method_set_item_checked>` for more info on how to control it.
  303. ----
  304. .. _class_PopupMenu_method_add_radio_check_shortcut:
  305. - void **add_radio_check_shortcut** **(** :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  306. Adds a new radio check button and assigns a :ref:`ShortCut<class_ShortCut>` to it. Sets the label of the checkbox to the :ref:`ShortCut<class_ShortCut>`'s name.
  307. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  308. **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked<class_PopupMenu_method_set_item_checked>` for more info on how to control it.
  309. ----
  310. .. _class_PopupMenu_method_add_separator:
  311. - void **add_separator** **(** :ref:`String<class_String>` label="" **)**
  312. Adds a separator between items. Separators also occupy an index.
  313. ----
  314. .. _class_PopupMenu_method_add_shortcut:
  315. - void **add_shortcut** **(** :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  316. Adds a :ref:`ShortCut<class_ShortCut>`.
  317. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  318. ----
  319. .. _class_PopupMenu_method_add_submenu_item:
  320. - void **add_submenu_item** **(** :ref:`String<class_String>` label, :ref:`String<class_String>` submenu, :ref:`int<class_int>` id=-1 **)**
  321. Adds an item that will act as a submenu of the parent ``PopupMenu`` node when clicked. The ``submenu`` argument is the name of the child ``PopupMenu`` node that will be shown when the item is clicked.
  322. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  323. ----
  324. .. _class_PopupMenu_method_clear:
  325. - void **clear** **(** **)**
  326. Removes all items from the ``PopupMenu``.
  327. ----
  328. .. _class_PopupMenu_method_get_item_accelerator:
  329. - :ref:`int<class_int>` **get_item_accelerator** **(** :ref:`int<class_int>` idx **)** const
  330. Returns the accelerator of the item at index ``idx``. Accelerators are special combinations of keys that activate the item, no matter which control is focused.
  331. ----
  332. .. _class_PopupMenu_method_get_item_count:
  333. - :ref:`int<class_int>` **get_item_count** **(** **)** const
  334. Returns the number of items in the ``PopupMenu``.
  335. ----
  336. .. _class_PopupMenu_method_get_item_icon:
  337. - :ref:`Texture2D<class_Texture2D>` **get_item_icon** **(** :ref:`int<class_int>` idx **)** const
  338. Returns the icon of the item at index ``idx``.
  339. ----
  340. .. _class_PopupMenu_method_get_item_id:
  341. - :ref:`int<class_int>` **get_item_id** **(** :ref:`int<class_int>` idx **)** const
  342. Returns the id of the item at index ``idx``. ``id`` can be manually assigned, while index can not.
  343. ----
  344. .. _class_PopupMenu_method_get_item_index:
  345. - :ref:`int<class_int>` **get_item_index** **(** :ref:`int<class_int>` id **)** const
  346. Returns the index of the item containing the specified ``id``. Index is automatically assigned to each item by the engine. Index can not be set manually.
  347. ----
  348. .. _class_PopupMenu_method_get_item_metadata:
  349. - :ref:`Variant<class_Variant>` **get_item_metadata** **(** :ref:`int<class_int>` idx **)** const
  350. Returns the metadata of the specified item, which might be of any type. You can set it with :ref:`set_item_metadata<class_PopupMenu_method_set_item_metadata>`, which provides a simple way of assigning context data to items.
  351. ----
  352. .. _class_PopupMenu_method_get_item_shortcut:
  353. - :ref:`ShortCut<class_ShortCut>` **get_item_shortcut** **(** :ref:`int<class_int>` idx **)** const
  354. Returns the :ref:`ShortCut<class_ShortCut>` associated with the specified ``idx`` item.
  355. ----
  356. .. _class_PopupMenu_method_get_item_submenu:
  357. - :ref:`String<class_String>` **get_item_submenu** **(** :ref:`int<class_int>` idx **)** const
  358. Returns the submenu name of the item at index ``idx``. See :ref:`add_submenu_item<class_PopupMenu_method_add_submenu_item>` for more info on how to add a submenu.
  359. ----
  360. .. _class_PopupMenu_method_get_item_text:
  361. - :ref:`String<class_String>` **get_item_text** **(** :ref:`int<class_int>` idx **)** const
  362. Returns the text of the item at index ``idx``.
  363. ----
  364. .. _class_PopupMenu_method_get_item_tooltip:
  365. - :ref:`String<class_String>` **get_item_tooltip** **(** :ref:`int<class_int>` idx **)** const
  366. Returns the tooltip associated with the specified index index ``idx``.
  367. ----
  368. .. _class_PopupMenu_method_is_hide_on_window_lose_focus:
  369. - :ref:`bool<class_bool>` **is_hide_on_window_lose_focus** **(** **)** const
  370. Returns ``true`` if the popup will be hidden when the window loses focus or not.
  371. ----
  372. .. _class_PopupMenu_method_is_item_checkable:
  373. - :ref:`bool<class_bool>` **is_item_checkable** **(** :ref:`int<class_int>` idx **)** const
  374. Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if it has a checkbox or radio button.
  375. **Note:** Checkable items just display a checkmark or radio button, but don't have any built-in checking behavior and must be checked/unchecked manually.
  376. ----
  377. .. _class_PopupMenu_method_is_item_checked:
  378. - :ref:`bool<class_bool>` **is_item_checked** **(** :ref:`int<class_int>` idx **)** const
  379. Returns ``true`` if the item at index ``idx`` is checked.
  380. ----
  381. .. _class_PopupMenu_method_is_item_disabled:
  382. - :ref:`bool<class_bool>` **is_item_disabled** **(** :ref:`int<class_int>` idx **)** const
  383. Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked.
  384. See :ref:`set_item_disabled<class_PopupMenu_method_set_item_disabled>` for more info on how to disable an item.
  385. ----
  386. .. _class_PopupMenu_method_is_item_radio_checkable:
  387. - :ref:`bool<class_bool>` **is_item_radio_checkable** **(** :ref:`int<class_int>` idx **)** const
  388. Returns ``true`` if the item at index ``idx`` has radio button-style checkability.
  389. **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  390. ----
  391. .. _class_PopupMenu_method_is_item_separator:
  392. - :ref:`bool<class_bool>` **is_item_separator** **(** :ref:`int<class_int>` idx **)** const
  393. Returns ``true`` if the item is a separator. If it is, it will be displayed as a line. See :ref:`add_separator<class_PopupMenu_method_add_separator>` for more info on how to add a separator.
  394. ----
  395. .. _class_PopupMenu_method_is_item_shortcut_disabled:
  396. - :ref:`bool<class_bool>` **is_item_shortcut_disabled** **(** :ref:`int<class_int>` idx **)** const
  397. Returns ``true`` if the specified item's shortcut is disabled.
  398. ----
  399. .. _class_PopupMenu_method_remove_item:
  400. - void **remove_item** **(** :ref:`int<class_int>` idx **)**
  401. Removes the item at index ``idx`` from the menu.
  402. **Note:** The indices of items after the removed item will be shifted by one.
  403. ----
  404. .. _class_PopupMenu_method_set_hide_on_window_lose_focus:
  405. - void **set_hide_on_window_lose_focus** **(** :ref:`bool<class_bool>` enable **)**
  406. Hides the ``PopupMenu`` when the window loses focus.
  407. ----
  408. .. _class_PopupMenu_method_set_item_accelerator:
  409. - void **set_item_accelerator** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` accel **)**
  410. Sets the accelerator of the item at index ``idx``. Accelerators are special combinations of keys that activate the item, no matter which control is focused.
  411. ----
  412. .. _class_PopupMenu_method_set_item_as_checkable:
  413. - void **set_item_as_checkable** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)**
  414. Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the type of the item to plain text.
  415. **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.
  416. ----
  417. .. _class_PopupMenu_method_set_item_as_radio_checkable:
  418. - void **set_item_as_radio_checkable** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)**
  419. Sets the type of the item at the specified index ``idx`` to radio button. If ``false``, sets the type of the item to plain text.
  420. ----
  421. .. _class_PopupMenu_method_set_item_as_separator:
  422. - void **set_item_as_separator** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)**
  423. Mark the item at index ``idx`` as a separator, which means that it would be displayed as a line. If ``false``, sets the type of the item to plain text.
  424. ----
  425. .. _class_PopupMenu_method_set_item_checked:
  426. - void **set_item_checked** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
  427. Sets the checkstate status of the item at index ``idx``.
  428. ----
  429. .. _class_PopupMenu_method_set_item_disabled:
  430. - void **set_item_disabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  431. Enables/disables the item at index ``idx``. When it is disabled, it can't be selected and its action can't be invoked.
  432. ----
  433. .. _class_PopupMenu_method_set_item_icon:
  434. - void **set_item_icon** **(** :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)**
  435. Replaces the :ref:`Texture2D<class_Texture2D>` icon of the specified ``idx``.
  436. ----
  437. .. _class_PopupMenu_method_set_item_id:
  438. - void **set_item_id** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)**
  439. Sets the ``id`` of the item at index ``idx``.
  440. ----
  441. .. _class_PopupMenu_method_set_item_metadata:
  442. - void **set_item_metadata** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)**
  443. Sets the metadata of an item, which may be of any type. You can later get it with :ref:`get_item_metadata<class_PopupMenu_method_get_item_metadata>`, which provides a simple way of assigning context data to items.
  444. ----
  445. .. _class_PopupMenu_method_set_item_multistate:
  446. - void **set_item_multistate** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)**
  447. Sets the state of an multistate item. See :ref:`add_multistate_item<class_PopupMenu_method_add_multistate_item>` for details.
  448. ----
  449. .. _class_PopupMenu_method_set_item_shortcut:
  450. - void **set_item_shortcut** **(** :ref:`int<class_int>` idx, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`bool<class_bool>` global=false **)**
  451. Sets a :ref:`ShortCut<class_ShortCut>` for the specified item ``idx``.
  452. ----
  453. .. _class_PopupMenu_method_set_item_shortcut_disabled:
  454. - void **set_item_shortcut_disabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  455. Disables the :ref:`ShortCut<class_ShortCut>` of the specified index ``idx``.
  456. ----
  457. .. _class_PopupMenu_method_set_item_submenu:
  458. - void **set_item_submenu** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
  459. Sets the submenu of the item at index ``idx``. The submenu is the name of a child ``PopupMenu`` node that would be shown when the item is clicked.
  460. ----
  461. .. _class_PopupMenu_method_set_item_text:
  462. - void **set_item_text** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  463. Sets the text of the item at index ``idx``.
  464. ----
  465. .. _class_PopupMenu_method_set_item_tooltip:
  466. - void **set_item_tooltip** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
  467. Sets the :ref:`String<class_String>` tooltip of the item at the specified index ``idx``.
  468. ----
  469. .. _class_PopupMenu_method_toggle_item_checked:
  470. - void **toggle_item_checked** **(** :ref:`int<class_int>` idx **)**
  471. Toggles the check state of the item of the specified index ``idx``.
  472. ----
  473. .. _class_PopupMenu_method_toggle_item_multistate:
  474. - void **toggle_item_multistate** **(** :ref:`int<class_int>` idx **)**
  475. Cycle to the next state of an multistate item. See :ref:`add_multistate_item<class_PopupMenu_method_add_multistate_item>` for details.