class_popupmenu.rst 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  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 | ``2`` *(parent override)* |
  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:`Texture<class_Texture>` 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:`Texture<class_Texture>` 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:`Texture<class_Texture>` 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:`Texture<class_Texture>` 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:`Texture<class_Texture>` 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:`Texture<class_Texture>` 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_current_index<class_PopupMenu_method_get_current_index>` **(** **)** |const| |
  64. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`int<class_int>` | :ref:`get_item_accelerator<class_PopupMenu_method_get_item_accelerator>` **(** :ref:`int<class_int>` idx **)** |const| |
  66. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`int<class_int>` | :ref:`get_item_count<class_PopupMenu_method_get_item_count>` **(** **)** |const| |
  68. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`Texture<class_Texture>` | :ref:`get_item_icon<class_PopupMenu_method_get_item_icon>` **(** :ref:`int<class_int>` idx **)** |const| |
  70. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`int<class_int>` | :ref:`get_item_id<class_PopupMenu_method_get_item_id>` **(** :ref:`int<class_int>` idx **)** |const| |
  72. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`int<class_int>` | :ref:`get_item_index<class_PopupMenu_method_get_item_index>` **(** :ref:`int<class_int>` id **)** |const| |
  74. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`Variant<class_Variant>` | :ref:`get_item_metadata<class_PopupMenu_method_get_item_metadata>` **(** :ref:`int<class_int>` idx **)** |const| |
  76. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`ShortCut<class_ShortCut>` | :ref:`get_item_shortcut<class_PopupMenu_method_get_item_shortcut>` **(** :ref:`int<class_int>` idx **)** |const| |
  78. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`String<class_String>` | :ref:`get_item_submenu<class_PopupMenu_method_get_item_submenu>` **(** :ref:`int<class_int>` idx **)** |const| |
  80. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`String<class_String>` | :ref:`get_item_text<class_PopupMenu_method_get_item_text>` **(** :ref:`int<class_int>` idx **)** |const| |
  82. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`String<class_String>` | :ref:`get_item_tooltip<class_PopupMenu_method_get_item_tooltip>` **(** :ref:`int<class_int>` idx **)** |const| |
  84. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`bool<class_bool>` | :ref:`is_hide_on_window_lose_focus<class_PopupMenu_method_is_hide_on_window_lose_focus>` **(** **)** |const| |
  86. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`bool<class_bool>` | :ref:`is_item_checkable<class_PopupMenu_method_is_item_checkable>` **(** :ref:`int<class_int>` idx **)** |const| |
  88. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`bool<class_bool>` | :ref:`is_item_checked<class_PopupMenu_method_is_item_checked>` **(** :ref:`int<class_int>` idx **)** |const| |
  90. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`bool<class_bool>` | :ref:`is_item_disabled<class_PopupMenu_method_is_item_disabled>` **(** :ref:`int<class_int>` idx **)** |const| |
  92. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`bool<class_bool>` | :ref:`is_item_radio_checkable<class_PopupMenu_method_is_item_radio_checkable>` **(** :ref:`int<class_int>` idx **)** |const| |
  94. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`bool<class_bool>` | :ref:`is_item_separator<class_PopupMenu_method_is_item_separator>` **(** :ref:`int<class_int>` idx **)** |const| |
  96. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`bool<class_bool>` | :ref:`is_item_shortcut_disabled<class_PopupMenu_method_is_item_shortcut_disabled>` **(** :ref:`int<class_int>` idx **)** |const| |
  98. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`remove_item<class_PopupMenu_method_remove_item>` **(** :ref:`int<class_int>` idx **)** |
  100. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`set_hide_on_window_lose_focus<class_PopupMenu_method_set_hide_on_window_lose_focus>` **(** :ref:`bool<class_bool>` enable **)** |
  102. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`set_item_accelerator<class_PopupMenu_method_set_item_accelerator>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` accel **)** |
  104. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | void | :ref:`set_item_as_checkable<class_PopupMenu_method_set_item_as_checkable>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)** |
  106. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | 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 **)** |
  108. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`set_item_as_separator<class_PopupMenu_method_set_item_as_separator>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)** |
  110. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | void | :ref:`set_item_checked<class_PopupMenu_method_set_item_checked>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)** |
  112. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`set_item_disabled<class_PopupMenu_method_set_item_disabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  114. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`set_item_icon<class_PopupMenu_method_set_item_icon>` **(** :ref:`int<class_int>` idx, :ref:`Texture<class_Texture>` icon **)** |
  116. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`set_item_id<class_PopupMenu_method_set_item_id>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)** |
  118. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`set_item_metadata<class_PopupMenu_method_set_item_metadata>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)** |
  120. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`set_item_multistate<class_PopupMenu_method_set_item_multistate>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)** |
  122. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | 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 **)** |
  124. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`set_item_shortcut_disabled<class_PopupMenu_method_set_item_shortcut_disabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  126. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | void | :ref:`set_item_submenu<class_PopupMenu_method_set_item_submenu>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)** |
  128. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | void | :ref:`set_item_text<class_PopupMenu_method_set_item_text>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)** |
  130. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`set_item_tooltip<class_PopupMenu_method_set_item_tooltip>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)** |
  132. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`toggle_item_checked<class_PopupMenu_method_toggle_item_checked>` **(** :ref:`int<class_int>` idx **)** |
  134. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | void | :ref:`toggle_item_multistate<class_PopupMenu_method_toggle_item_multistate>` **(** :ref:`int<class_int>` idx **)** |
  136. +---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. Theme Properties
  138. ----------------
  139. +---------------------------------+-------------------------+------------------------------+
  140. | :ref:`Texture<class_Texture>` | checked | |
  141. +---------------------------------+-------------------------+------------------------------+
  142. | :ref:`Font<class_Font>` | font | |
  143. +---------------------------------+-------------------------+------------------------------+
  144. | :ref:`Color<class_Color>` | font_color | Color( 0.88, 0.88, 0.88, 1 ) |
  145. +---------------------------------+-------------------------+------------------------------+
  146. | :ref:`Color<class_Color>` | font_color_accel | Color( 0.7, 0.7, 0.7, 0.8 ) |
  147. +---------------------------------+-------------------------+------------------------------+
  148. | :ref:`Color<class_Color>` | font_color_disabled | Color( 0.4, 0.4, 0.4, 0.8 ) |
  149. +---------------------------------+-------------------------+------------------------------+
  150. | :ref:`Color<class_Color>` | font_color_hover | Color( 0.88, 0.88, 0.88, 1 ) |
  151. +---------------------------------+-------------------------+------------------------------+
  152. | :ref:`StyleBox<class_StyleBox>` | hover | |
  153. +---------------------------------+-------------------------+------------------------------+
  154. | :ref:`int<class_int>` | hseparation | 4 |
  155. +---------------------------------+-------------------------+------------------------------+
  156. | :ref:`StyleBox<class_StyleBox>` | labeled_separator_left | |
  157. +---------------------------------+-------------------------+------------------------------+
  158. | :ref:`StyleBox<class_StyleBox>` | labeled_separator_right | |
  159. +---------------------------------+-------------------------+------------------------------+
  160. | :ref:`StyleBox<class_StyleBox>` | panel | |
  161. +---------------------------------+-------------------------+------------------------------+
  162. | :ref:`StyleBox<class_StyleBox>` | panel_disabled | |
  163. +---------------------------------+-------------------------+------------------------------+
  164. | :ref:`Texture<class_Texture>` | radio_checked | |
  165. +---------------------------------+-------------------------+------------------------------+
  166. | :ref:`Texture<class_Texture>` | radio_unchecked | |
  167. +---------------------------------+-------------------------+------------------------------+
  168. | :ref:`StyleBox<class_StyleBox>` | separator | |
  169. +---------------------------------+-------------------------+------------------------------+
  170. | :ref:`Texture<class_Texture>` | submenu | |
  171. +---------------------------------+-------------------------+------------------------------+
  172. | :ref:`Texture<class_Texture>` | unchecked | |
  173. +---------------------------------+-------------------------+------------------------------+
  174. | :ref:`int<class_int>` | vseparation | 4 |
  175. +---------------------------------+-------------------------+------------------------------+
  176. Signals
  177. -------
  178. .. _class_PopupMenu_signal_id_focused:
  179. - **id_focused** **(** :ref:`int<class_int>` id **)**
  180. Emitted when user navigated to an item of some ``id`` using ``ui_up`` or ``ui_down`` action.
  181. ----
  182. .. _class_PopupMenu_signal_id_pressed:
  183. - **id_pressed** **(** :ref:`int<class_int>` id **)**
  184. Emitted when an item of some ``id`` is pressed or its accelerator is activated.
  185. ----
  186. .. _class_PopupMenu_signal_index_pressed:
  187. - **index_pressed** **(** :ref:`int<class_int>` index **)**
  188. Emitted when an item of some ``index`` is pressed or its accelerator is activated.
  189. Property Descriptions
  190. ---------------------
  191. .. _class_PopupMenu_property_allow_search:
  192. - :ref:`bool<class_bool>` **allow_search**
  193. +-----------+-------------------------+
  194. | *Default* | ``false`` |
  195. +-----------+-------------------------+
  196. | *Setter* | set_allow_search(value) |
  197. +-----------+-------------------------+
  198. | *Getter* | get_allow_search() |
  199. +-----------+-------------------------+
  200. If ``true``, allows to navigate ``PopupMenu`` with letter keys.
  201. ----
  202. .. _class_PopupMenu_property_hide_on_checkable_item_selection:
  203. - :ref:`bool<class_bool>` **hide_on_checkable_item_selection**
  204. +-----------+---------------------------------------------+
  205. | *Default* | ``true`` |
  206. +-----------+---------------------------------------------+
  207. | *Setter* | set_hide_on_checkable_item_selection(value) |
  208. +-----------+---------------------------------------------+
  209. | *Getter* | is_hide_on_checkable_item_selection() |
  210. +-----------+---------------------------------------------+
  211. If ``true``, hides the ``PopupMenu`` when a checkbox or radio button is selected.
  212. ----
  213. .. _class_PopupMenu_property_hide_on_item_selection:
  214. - :ref:`bool<class_bool>` **hide_on_item_selection**
  215. +-----------+-----------------------------------+
  216. | *Default* | ``true`` |
  217. +-----------+-----------------------------------+
  218. | *Setter* | set_hide_on_item_selection(value) |
  219. +-----------+-----------------------------------+
  220. | *Getter* | is_hide_on_item_selection() |
  221. +-----------+-----------------------------------+
  222. If ``true``, hides the ``PopupMenu`` when an item is selected.
  223. ----
  224. .. _class_PopupMenu_property_hide_on_state_item_selection:
  225. - :ref:`bool<class_bool>` **hide_on_state_item_selection**
  226. +-----------+-----------------------------------------+
  227. | *Default* | ``false`` |
  228. +-----------+-----------------------------------------+
  229. | *Setter* | set_hide_on_state_item_selection(value) |
  230. +-----------+-----------------------------------------+
  231. | *Getter* | is_hide_on_state_item_selection() |
  232. +-----------+-----------------------------------------+
  233. If ``true``, hides the ``PopupMenu`` when a state item is selected.
  234. ----
  235. .. _class_PopupMenu_property_submenu_popup_delay:
  236. - :ref:`float<class_float>` **submenu_popup_delay**
  237. +-----------+--------------------------------+
  238. | *Default* | ``0.3`` |
  239. +-----------+--------------------------------+
  240. | *Setter* | set_submenu_popup_delay(value) |
  241. +-----------+--------------------------------+
  242. | *Getter* | get_submenu_popup_delay() |
  243. +-----------+--------------------------------+
  244. 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.
  245. Method Descriptions
  246. -------------------
  247. .. _class_PopupMenu_method_add_check_item:
  248. - void **add_check_item** **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  249. Adds a new checkable item with text ``label``.
  250. 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.
  251. **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.
  252. ----
  253. .. _class_PopupMenu_method_add_check_shortcut:
  254. - void **add_check_shortcut** **(** :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  255. 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.
  256. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  257. **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.
  258. ----
  259. .. _class_PopupMenu_method_add_icon_check_item:
  260. - void **add_icon_check_item** **(** :ref:`Texture<class_Texture>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  261. Adds a new checkable item with text ``label`` and icon ``texture``.
  262. 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.
  263. **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.
  264. ----
  265. .. _class_PopupMenu_method_add_icon_check_shortcut:
  266. - void **add_icon_check_shortcut** **(** :ref:`Texture<class_Texture>` texture, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  267. 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.
  268. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  269. **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.
  270. ----
  271. .. _class_PopupMenu_method_add_icon_item:
  272. - void **add_icon_item** **(** :ref:`Texture<class_Texture>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  273. Adds a new item with text ``label`` and icon ``texture``.
  274. 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.
  275. ----
  276. .. _class_PopupMenu_method_add_icon_radio_check_item:
  277. - void **add_icon_radio_check_item** **(** :ref:`Texture<class_Texture>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  278. Same as :ref:`add_icon_check_item<class_PopupMenu_method_add_icon_check_item>`, but uses a radio check button.
  279. ----
  280. .. _class_PopupMenu_method_add_icon_radio_check_shortcut:
  281. - void **add_icon_radio_check_shortcut** **(** :ref:`Texture<class_Texture>` texture, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  282. Same as :ref:`add_icon_check_shortcut<class_PopupMenu_method_add_icon_check_shortcut>`, but uses a radio check button.
  283. ----
  284. .. _class_PopupMenu_method_add_icon_shortcut:
  285. - void **add_icon_shortcut** **(** :ref:`Texture<class_Texture>` texture, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  286. 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.
  287. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  288. ----
  289. .. _class_PopupMenu_method_add_item:
  290. - void **add_item** **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  291. Adds a new item with text ``label``.
  292. 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.
  293. ----
  294. .. _class_PopupMenu_method_add_multistate_item:
  295. - 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 **)**
  296. Adds a new multistate item with text ``label``.
  297. 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``.
  298. 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.
  299. ----
  300. .. _class_PopupMenu_method_add_radio_check_item:
  301. - void **add_radio_check_item** **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  302. Adds a new radio check button with text ``label``.
  303. 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.
  304. **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.
  305. ----
  306. .. _class_PopupMenu_method_add_radio_check_shortcut:
  307. - void **add_radio_check_shortcut** **(** :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  308. 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.
  309. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  310. **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.
  311. ----
  312. .. _class_PopupMenu_method_add_separator:
  313. - void **add_separator** **(** :ref:`String<class_String>` label="" **)**
  314. Adds a separator between items. Separators also occupy an index.
  315. ----
  316. .. _class_PopupMenu_method_add_shortcut:
  317. - void **add_shortcut** **(** :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  318. Adds a :ref:`ShortCut<class_ShortCut>`.
  319. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  320. ----
  321. .. _class_PopupMenu_method_add_submenu_item:
  322. - void **add_submenu_item** **(** :ref:`String<class_String>` label, :ref:`String<class_String>` submenu, :ref:`int<class_int>` id=-1 **)**
  323. 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.
  324. An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index.
  325. ----
  326. .. _class_PopupMenu_method_clear:
  327. - void **clear** **(** **)**
  328. Removes all items from the ``PopupMenu``.
  329. ----
  330. .. _class_PopupMenu_method_get_current_index:
  331. - :ref:`int<class_int>` **get_current_index** **(** **)** |const|
  332. ----
  333. .. _class_PopupMenu_method_get_item_accelerator:
  334. - :ref:`int<class_int>` **get_item_accelerator** **(** :ref:`int<class_int>` idx **)** |const|
  335. 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.
  336. ----
  337. .. _class_PopupMenu_method_get_item_count:
  338. - :ref:`int<class_int>` **get_item_count** **(** **)** |const|
  339. Returns the number of items in the ``PopupMenu``.
  340. ----
  341. .. _class_PopupMenu_method_get_item_icon:
  342. - :ref:`Texture<class_Texture>` **get_item_icon** **(** :ref:`int<class_int>` idx **)** |const|
  343. Returns the icon of the item at index ``idx``.
  344. ----
  345. .. _class_PopupMenu_method_get_item_id:
  346. - :ref:`int<class_int>` **get_item_id** **(** :ref:`int<class_int>` idx **)** |const|
  347. Returns the id of the item at index ``idx``. ``id`` can be manually assigned, while index can not.
  348. ----
  349. .. _class_PopupMenu_method_get_item_index:
  350. - :ref:`int<class_int>` **get_item_index** **(** :ref:`int<class_int>` id **)** |const|
  351. 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.
  352. ----
  353. .. _class_PopupMenu_method_get_item_metadata:
  354. - :ref:`Variant<class_Variant>` **get_item_metadata** **(** :ref:`int<class_int>` idx **)** |const|
  355. 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.
  356. ----
  357. .. _class_PopupMenu_method_get_item_shortcut:
  358. - :ref:`ShortCut<class_ShortCut>` **get_item_shortcut** **(** :ref:`int<class_int>` idx **)** |const|
  359. Returns the :ref:`ShortCut<class_ShortCut>` associated with the specified ``idx`` item.
  360. ----
  361. .. _class_PopupMenu_method_get_item_submenu:
  362. - :ref:`String<class_String>` **get_item_submenu** **(** :ref:`int<class_int>` idx **)** |const|
  363. 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.
  364. ----
  365. .. _class_PopupMenu_method_get_item_text:
  366. - :ref:`String<class_String>` **get_item_text** **(** :ref:`int<class_int>` idx **)** |const|
  367. Returns the text of the item at index ``idx``.
  368. ----
  369. .. _class_PopupMenu_method_get_item_tooltip:
  370. - :ref:`String<class_String>` **get_item_tooltip** **(** :ref:`int<class_int>` idx **)** |const|
  371. Returns the tooltip associated with the specified index index ``idx``.
  372. ----
  373. .. _class_PopupMenu_method_is_hide_on_window_lose_focus:
  374. - :ref:`bool<class_bool>` **is_hide_on_window_lose_focus** **(** **)** |const|
  375. Returns ``true`` if the popup will be hidden when the window loses focus or not.
  376. ----
  377. .. _class_PopupMenu_method_is_item_checkable:
  378. - :ref:`bool<class_bool>` **is_item_checkable** **(** :ref:`int<class_int>` idx **)** |const|
  379. Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if it has a checkbox or radio button.
  380. **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.
  381. ----
  382. .. _class_PopupMenu_method_is_item_checked:
  383. - :ref:`bool<class_bool>` **is_item_checked** **(** :ref:`int<class_int>` idx **)** |const|
  384. Returns ``true`` if the item at index ``idx`` is checked.
  385. ----
  386. .. _class_PopupMenu_method_is_item_disabled:
  387. - :ref:`bool<class_bool>` **is_item_disabled** **(** :ref:`int<class_int>` idx **)** |const|
  388. Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked.
  389. See :ref:`set_item_disabled<class_PopupMenu_method_set_item_disabled>` for more info on how to disable an item.
  390. ----
  391. .. _class_PopupMenu_method_is_item_radio_checkable:
  392. - :ref:`bool<class_bool>` **is_item_radio_checkable** **(** :ref:`int<class_int>` idx **)** |const|
  393. Returns ``true`` if the item at index ``idx`` has radio button-style checkability.
  394. **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
  395. ----
  396. .. _class_PopupMenu_method_is_item_separator:
  397. - :ref:`bool<class_bool>` **is_item_separator** **(** :ref:`int<class_int>` idx **)** |const|
  398. 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.
  399. ----
  400. .. _class_PopupMenu_method_is_item_shortcut_disabled:
  401. - :ref:`bool<class_bool>` **is_item_shortcut_disabled** **(** :ref:`int<class_int>` idx **)** |const|
  402. Returns ``true`` if the specified item's shortcut is disabled.
  403. ----
  404. .. _class_PopupMenu_method_remove_item:
  405. - void **remove_item** **(** :ref:`int<class_int>` idx **)**
  406. Removes the item at index ``idx`` from the menu.
  407. **Note:** The indices of items after the removed item will be shifted by one.
  408. ----
  409. .. _class_PopupMenu_method_set_hide_on_window_lose_focus:
  410. - void **set_hide_on_window_lose_focus** **(** :ref:`bool<class_bool>` enable **)**
  411. Hides the ``PopupMenu`` when the window loses focus.
  412. ----
  413. .. _class_PopupMenu_method_set_item_accelerator:
  414. - void **set_item_accelerator** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` accel **)**
  415. 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.
  416. ----
  417. .. _class_PopupMenu_method_set_item_as_checkable:
  418. - void **set_item_as_checkable** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)**
  419. Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the type of the item to plain text.
  420. **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.
  421. ----
  422. .. _class_PopupMenu_method_set_item_as_radio_checkable:
  423. - void **set_item_as_radio_checkable** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)**
  424. 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.
  425. ----
  426. .. _class_PopupMenu_method_set_item_as_separator:
  427. - void **set_item_as_separator** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)**
  428. 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.
  429. ----
  430. .. _class_PopupMenu_method_set_item_checked:
  431. - void **set_item_checked** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
  432. Sets the checkstate status of the item at index ``idx``.
  433. ----
  434. .. _class_PopupMenu_method_set_item_disabled:
  435. - void **set_item_disabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  436. Enables/disables the item at index ``idx``. When it is disabled, it can't be selected and its action can't be invoked.
  437. ----
  438. .. _class_PopupMenu_method_set_item_icon:
  439. - void **set_item_icon** **(** :ref:`int<class_int>` idx, :ref:`Texture<class_Texture>` icon **)**
  440. Replaces the :ref:`Texture<class_Texture>` icon of the specified ``idx``.
  441. ----
  442. .. _class_PopupMenu_method_set_item_id:
  443. - void **set_item_id** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)**
  444. Sets the ``id`` of the item at index ``idx``.
  445. ----
  446. .. _class_PopupMenu_method_set_item_metadata:
  447. - void **set_item_metadata** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)**
  448. 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.
  449. ----
  450. .. _class_PopupMenu_method_set_item_multistate:
  451. - void **set_item_multistate** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)**
  452. Sets the state of an multistate item. See :ref:`add_multistate_item<class_PopupMenu_method_add_multistate_item>` for details.
  453. ----
  454. .. _class_PopupMenu_method_set_item_shortcut:
  455. - void **set_item_shortcut** **(** :ref:`int<class_int>` idx, :ref:`ShortCut<class_ShortCut>` shortcut, :ref:`bool<class_bool>` global=false **)**
  456. Sets a :ref:`ShortCut<class_ShortCut>` for the specified item ``idx``.
  457. ----
  458. .. _class_PopupMenu_method_set_item_shortcut_disabled:
  459. - void **set_item_shortcut_disabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  460. Disables the :ref:`ShortCut<class_ShortCut>` of the specified index ``idx``.
  461. ----
  462. .. _class_PopupMenu_method_set_item_submenu:
  463. - void **set_item_submenu** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
  464. 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.
  465. ----
  466. .. _class_PopupMenu_method_set_item_text:
  467. - void **set_item_text** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  468. Sets the text of the item at index ``idx``.
  469. ----
  470. .. _class_PopupMenu_method_set_item_tooltip:
  471. - void **set_item_tooltip** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
  472. Sets the :ref:`String<class_String>` tooltip of the item at the specified index ``idx``.
  473. ----
  474. .. _class_PopupMenu_method_toggle_item_checked:
  475. - void **toggle_item_checked** **(** :ref:`int<class_int>` idx **)**
  476. Toggles the check state of the item of the specified index ``idx``.
  477. ----
  478. .. _class_PopupMenu_method_toggle_item_multistate:
  479. - void **toggle_item_multistate** **(** :ref:`int<class_int>` idx **)**
  480. Cycle to the next state of an multistate item. See :ref:`add_multistate_item<class_PopupMenu_method_add_multistate_item>` for details.
  481. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  482. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  483. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`