class_popupmenu.rst 34 KB

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