class_popupmenu.rst 59 KB

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