class_popupmenu.rst 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_PopupMenu:
  4. PopupMenu
  5. =========
  6. **Inherits:** :ref:`Popup<class_popup>` **<** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. PopupMenu displays a list of options.
  11. Member Functions
  12. ----------------
  13. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`add_check_item<class_PopupMenu_add_check_item>` **(** :ref:`String<class_string>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)** |
  15. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`add_check_shortcut<class_PopupMenu_add_check_shortcut>` **(** :ref:`ShortCut<class_shortcut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)** |
  17. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`add_icon_check_item<class_PopupMenu_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 **)** |
  19. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`add_icon_check_shortcut<class_PopupMenu_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 **)** |
  21. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`add_icon_item<class_PopupMenu_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 **)** |
  23. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`add_icon_shortcut<class_PopupMenu_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 **)** |
  25. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`add_item<class_PopupMenu_add_item>` **(** :ref:`String<class_string>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)** |
  27. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`add_separator<class_PopupMenu_add_separator>` **(** **)** |
  29. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`add_shortcut<class_PopupMenu_add_shortcut>` **(** :ref:`ShortCut<class_shortcut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)** |
  31. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`add_submenu_item<class_PopupMenu_add_submenu_item>` **(** :ref:`String<class_string>` label, :ref:`String<class_string>` submenu, :ref:`int<class_int>` id=-1 **)** |
  33. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`clear<class_PopupMenu_clear>` **(** **)** |
  35. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`get_item_accelerator<class_PopupMenu_get_item_accelerator>` **(** :ref:`int<class_int>` idx **)** const |
  37. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`int<class_int>` | :ref:`get_item_count<class_PopupMenu_get_item_count>` **(** **)** const |
  39. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`Texture<class_texture>` | :ref:`get_item_icon<class_PopupMenu_get_item_icon>` **(** :ref:`int<class_int>` idx **)** const |
  41. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`int<class_int>` | :ref:`get_item_id<class_PopupMenu_get_item_id>` **(** :ref:`int<class_int>` idx **)** const |
  43. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`int<class_int>` | :ref:`get_item_index<class_PopupMenu_get_item_index>` **(** :ref:`int<class_int>` id **)** const |
  45. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Variant<class_variant>` | :ref:`get_item_metadata<class_PopupMenu_get_item_metadata>` **(** :ref:`int<class_int>` idx **)** const |
  47. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`ShortCut<class_shortcut>` | :ref:`get_item_shortcut<class_PopupMenu_get_item_shortcut>` **(** :ref:`int<class_int>` idx **)** const |
  49. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`String<class_string>` | :ref:`get_item_submenu<class_PopupMenu_get_item_submenu>` **(** :ref:`int<class_int>` idx **)** const |
  51. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`String<class_string>` | :ref:`get_item_text<class_PopupMenu_get_item_text>` **(** :ref:`int<class_int>` idx **)** const |
  53. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`String<class_string>` | :ref:`get_item_tooltip<class_PopupMenu_get_item_tooltip>` **(** :ref:`int<class_int>` idx **)** const |
  55. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`bool<class_bool>` | :ref:`is_hide_on_checkable_item_selection<class_PopupMenu_is_hide_on_checkable_item_selection>` **(** **)** |
  57. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`is_hide_on_item_selection<class_PopupMenu_is_hide_on_item_selection>` **(** **)** |
  59. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`is_item_checkable<class_PopupMenu_is_item_checkable>` **(** :ref:`int<class_int>` idx **)** const |
  61. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`is_item_checked<class_PopupMenu_is_item_checked>` **(** :ref:`int<class_int>` idx **)** const |
  63. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`is_item_disabled<class_PopupMenu_is_item_disabled>` **(** :ref:`int<class_int>` idx **)** const |
  65. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`bool<class_bool>` | :ref:`is_item_separator<class_PopupMenu_is_item_separator>` **(** :ref:`int<class_int>` idx **)** const |
  67. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`remove_item<class_PopupMenu_remove_item>` **(** :ref:`int<class_int>` idx **)** |
  69. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`set_hide_on_checkable_item_selection<class_PopupMenu_set_hide_on_checkable_item_selection>` **(** :ref:`bool<class_bool>` enable **)** |
  71. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`set_hide_on_item_selection<class_PopupMenu_set_hide_on_item_selection>` **(** :ref:`bool<class_bool>` enable **)** |
  73. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`set_item_accelerator<class_PopupMenu_set_item_accelerator>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` accel **)** |
  75. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`set_item_as_checkable<class_PopupMenu_set_item_as_checkable>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)** |
  77. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`set_item_as_separator<class_PopupMenu_set_item_as_separator>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)** |
  79. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`set_item_checked<class_PopupMenu_set_item_checked>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)** |
  81. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`set_item_disabled<class_PopupMenu_set_item_disabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  83. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`set_item_icon<class_PopupMenu_set_item_icon>` **(** :ref:`int<class_int>` idx, :ref:`Texture<class_texture>` icon **)** |
  85. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`set_item_id<class_PopupMenu_set_item_id>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)** |
  87. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`set_item_metadata<class_PopupMenu_set_item_metadata>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_variant>` metadata **)** |
  89. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`set_item_shortcut<class_PopupMenu_set_item_shortcut>` **(** :ref:`int<class_int>` idx, :ref:`ShortCut<class_shortcut>` shortcut, :ref:`bool<class_bool>` global=false **)** |
  91. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`set_item_submenu<class_PopupMenu_set_item_submenu>` **(** :ref:`int<class_int>` idx, :ref:`String<class_string>` submenu **)** |
  93. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | void | :ref:`set_item_text<class_PopupMenu_set_item_text>` **(** :ref:`int<class_int>` idx, :ref:`String<class_string>` text **)** |
  95. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | void | :ref:`set_item_tooltip<class_PopupMenu_set_item_tooltip>` **(** :ref:`int<class_int>` idx, :ref:`String<class_string>` tooltip **)** |
  97. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | void | :ref:`toggle_item_checked<class_PopupMenu_toggle_item_checked>` **(** :ref:`int<class_int>` idx **)** |
  99. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. Signals
  101. -------
  102. - **id_pressed** **(** :ref:`int<class_int>` ID **)**
  103. This event is emitted when an item of some id is pressed or its accelerator is activated.
  104. - **index_pressed** **(** :ref:`int<class_int>` index **)**
  105. This event is emitted when an item of some index is pressed or its accelerator is activated.
  106. Member Variables
  107. ----------------
  108. - :ref:`bool<class_bool>` **hide_on_checkable_item_selection**
  109. - :ref:`bool<class_bool>` **hide_on_item_selection**
  110. - :ref:`Array<class_array>` **items**
  111. Description
  112. -----------
  113. PopupMenu is the typical Control that displays a list of options. They are popular in toolbars or context menus.
  114. Member Function Description
  115. ---------------------------
  116. .. _class_PopupMenu_add_check_item:
  117. - void **add_check_item** **(** :ref:`String<class_string>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  118. Add a new checkable item with text "label". An id can optionally be provided, as well as an accelerator. If no id is provided, one will be created from the index. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.
  119. .. _class_PopupMenu_add_check_shortcut:
  120. - void **add_check_shortcut** **(** :ref:`ShortCut<class_shortcut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  121. .. _class_PopupMenu_add_icon_check_item:
  122. - 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 **)**
  123. Add a new checkable item with text "label" and icon "texture". An id can optionally be provided, as well as an accelerator. If no id is provided, one will be
  124. created from the index. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.
  125. .. _class_PopupMenu_add_icon_check_shortcut:
  126. - 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 **)**
  127. .. _class_PopupMenu_add_icon_item:
  128. - 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 **)**
  129. Add a new item with text "label" and icon "texture". An id can optionally be provided, as well as an accelerator keybinding. If no id is provided, one will be created from the index.
  130. .. _class_PopupMenu_add_icon_shortcut:
  131. - 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 **)**
  132. .. _class_PopupMenu_add_item:
  133. - void **add_item** **(** :ref:`String<class_string>` label, :ref:`int<class_int>` id=-1, :ref:`int<class_int>` accel=0 **)**
  134. Add a new item with text "label". An id can optionally be provided, as well as an accelerator keybinding. If no id is provided, one will be created from the index.
  135. .. _class_PopupMenu_add_separator:
  136. - void **add_separator** **(** **)**
  137. Add a separator between items. Separators also occupy an index.
  138. .. _class_PopupMenu_add_shortcut:
  139. - void **add_shortcut** **(** :ref:`ShortCut<class_shortcut>` shortcut, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` global=false **)**
  140. .. _class_PopupMenu_add_submenu_item:
  141. - void **add_submenu_item** **(** :ref:`String<class_string>` label, :ref:`String<class_string>` submenu, :ref:`int<class_int>` id=-1 **)**
  142. Adds an item with a submenu. The submenu is the name of a child PopupMenu node that would be shown when the item is clicked. An id can optionally be provided, but if is isn't provided, one will be created from the index.
  143. .. _class_PopupMenu_clear:
  144. - void **clear** **(** **)**
  145. Clear the popup menu, in effect removing all items.
  146. .. _class_PopupMenu_get_item_accelerator:
  147. - :ref:`int<class_int>` **get_item_accelerator** **(** :ref:`int<class_int>` idx **)** const
  148. Return the accelerator of the item at index "idx". Accelerators are special combinations of keys that activate the item, no matter which control is focused.
  149. .. _class_PopupMenu_get_item_count:
  150. - :ref:`int<class_int>` **get_item_count** **(** **)** const
  151. Return the amount of items.
  152. .. _class_PopupMenu_get_item_icon:
  153. - :ref:`Texture<class_texture>` **get_item_icon** **(** :ref:`int<class_int>` idx **)** const
  154. Return the icon of the item at index "idx".
  155. .. _class_PopupMenu_get_item_id:
  156. - :ref:`int<class_int>` **get_item_id** **(** :ref:`int<class_int>` idx **)** const
  157. Return the id of the item at index "idx".
  158. .. _class_PopupMenu_get_item_index:
  159. - :ref:`int<class_int>` **get_item_index** **(** :ref:`int<class_int>` id **)** const
  160. Find and return the index of the item containing a given id.
  161. .. _class_PopupMenu_get_item_metadata:
  162. - :ref:`Variant<class_variant>` **get_item_metadata** **(** :ref:`int<class_int>` idx **)** const
  163. Return the metadata of an item, which might be of any type. You can set it with :ref:`set_item_metadata<class_PopupMenu_set_item_metadata>`, which provides a simple way of assigning context data to items.
  164. .. _class_PopupMenu_get_item_shortcut:
  165. - :ref:`ShortCut<class_shortcut>` **get_item_shortcut** **(** :ref:`int<class_int>` idx **)** const
  166. .. _class_PopupMenu_get_item_submenu:
  167. - :ref:`String<class_string>` **get_item_submenu** **(** :ref:`int<class_int>` idx **)** const
  168. Return the submenu name of the item at index "idx".
  169. .. _class_PopupMenu_get_item_text:
  170. - :ref:`String<class_string>` **get_item_text** **(** :ref:`int<class_int>` idx **)** const
  171. Return the text of the item at index "idx".
  172. .. _class_PopupMenu_get_item_tooltip:
  173. - :ref:`String<class_string>` **get_item_tooltip** **(** :ref:`int<class_int>` idx **)** const
  174. .. _class_PopupMenu_is_hide_on_checkable_item_selection:
  175. - :ref:`bool<class_bool>` **is_hide_on_checkable_item_selection** **(** **)**
  176. Returns a boolean that indicates whether or not the PopupMenu will hide on checkable item selection.
  177. .. _class_PopupMenu_is_hide_on_item_selection:
  178. - :ref:`bool<class_bool>` **is_hide_on_item_selection** **(** **)**
  179. Returns a boolean that indicates whether or not the PopupMenu will hide on item selection.
  180. .. _class_PopupMenu_is_item_checkable:
  181. - :ref:`bool<class_bool>` **is_item_checkable** **(** :ref:`int<class_int>` idx **)** const
  182. Return whether the item at index "idx" has a checkbox. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.
  183. .. _class_PopupMenu_is_item_checked:
  184. - :ref:`bool<class_bool>` **is_item_checked** **(** :ref:`int<class_int>` idx **)** const
  185. Return the checkstate status of the item at index "idx".
  186. .. _class_PopupMenu_is_item_disabled:
  187. - :ref:`bool<class_bool>` **is_item_disabled** **(** :ref:`int<class_int>` idx **)** const
  188. Return whether the item at index "idx" is disabled. When it is disabled it can't be selected, or its action invoked.
  189. .. _class_PopupMenu_is_item_separator:
  190. - :ref:`bool<class_bool>` **is_item_separator** **(** :ref:`int<class_int>` idx **)** const
  191. Return whether the item is a seperator. If it is, it would be displayed as a line.
  192. .. _class_PopupMenu_remove_item:
  193. - void **remove_item** **(** :ref:`int<class_int>` idx **)**
  194. Removes the item at index "idx" from the menu. Note that the indexes of items after the removed item are going to be shifted by one.
  195. .. _class_PopupMenu_set_hide_on_checkable_item_selection:
  196. - void **set_hide_on_checkable_item_selection** **(** :ref:`bool<class_bool>` enable **)**
  197. Sets whether or not the PopupMenu will hide on checkable item selection.
  198. .. _class_PopupMenu_set_hide_on_item_selection:
  199. - void **set_hide_on_item_selection** **(** :ref:`bool<class_bool>` enable **)**
  200. Sets whether or not the PopupMenu will hide on item selection.
  201. .. _class_PopupMenu_set_item_accelerator:
  202. - void **set_item_accelerator** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` accel **)**
  203. Set the accelerator of the item at index "idx". Accelerators are special combinations of keys that activate the item, no matter which control is focused.
  204. .. _class_PopupMenu_set_item_as_checkable:
  205. - void **set_item_as_checkable** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)**
  206. Set whether the item at index "idx" has a checkbox. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.
  207. .. _class_PopupMenu_set_item_as_separator:
  208. - void **set_item_as_separator** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` enable **)**
  209. Mark the item at index "idx" as a seperator, which means that it would be displayed as a mere line.
  210. .. _class_PopupMenu_set_item_checked:
  211. - void **set_item_checked** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
  212. Set the checkstate status of the item at index "idx".
  213. .. _class_PopupMenu_set_item_disabled:
  214. - void **set_item_disabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  215. Sets whether the item at index "idx" is disabled or not. When it is disabled it can't be selected, or its action invoked.
  216. .. _class_PopupMenu_set_item_icon:
  217. - void **set_item_icon** **(** :ref:`int<class_int>` idx, :ref:`Texture<class_texture>` icon **)**
  218. .. _class_PopupMenu_set_item_id:
  219. - void **set_item_id** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)**
  220. Set the id of the item at index "idx".
  221. .. _class_PopupMenu_set_item_metadata:
  222. - void **set_item_metadata** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_variant>` metadata **)**
  223. Sets the metadata of an item, which might be of any type. You can later get it with :ref:`get_item_metadata<class_PopupMenu_get_item_metadata>`, which provides a simple way of assigning context data to items.
  224. .. _class_PopupMenu_set_item_shortcut:
  225. - void **set_item_shortcut** **(** :ref:`int<class_int>` idx, :ref:`ShortCut<class_shortcut>` shortcut, :ref:`bool<class_bool>` global=false **)**
  226. .. _class_PopupMenu_set_item_submenu:
  227. - void **set_item_submenu** **(** :ref:`int<class_int>` idx, :ref:`String<class_string>` submenu **)**
  228. 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.
  229. .. _class_PopupMenu_set_item_text:
  230. - void **set_item_text** **(** :ref:`int<class_int>` idx, :ref:`String<class_string>` text **)**
  231. Set the text of the item at index "idx".
  232. .. _class_PopupMenu_set_item_tooltip:
  233. - void **set_item_tooltip** **(** :ref:`int<class_int>` idx, :ref:`String<class_string>` tooltip **)**
  234. .. _class_PopupMenu_toggle_item_checked:
  235. - void **toggle_item_checked** **(** :ref:`int<class_int>` idx **)**