|
@@ -0,0 +1,1211 @@
|
|
|
|
+:github_url: hide
|
|
|
|
+
|
|
|
|
+.. DO NOT EDIT THIS FILE!!!
|
|
|
|
+.. Generated automatically from Godot engine sources.
|
|
|
|
+.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
|
|
|
+.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/NativeMenu.xml.
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu:
|
|
|
|
+
|
|
|
|
+NativeMenu
|
|
|
|
+==========
|
|
|
|
+
|
|
|
|
+**Inherits:** :ref:`Object<class_Object>`
|
|
|
|
+
|
|
|
|
+A server interface for OS native menus.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-introduction-group
|
|
|
|
+
|
|
|
|
+Description
|
|
|
|
+-----------
|
|
|
|
+
|
|
|
|
+**NativeMenu** handles low-level access to the OS native global menu bar and popup menus.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-reftable-group
|
|
|
|
+
|
|
|
|
+Methods
|
|
|
|
+-------
|
|
|
|
+
|
|
|
|
+.. table::
|
|
|
|
+ :widths: auto
|
|
|
|
+
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`add_check_item<class_NativeMenu_method_add_check_item>`\ (\ rid\: :ref:`RID<class_RID>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`add_icon_check_item<class_NativeMenu_method_add_icon_check_item>`\ (\ rid\: :ref:`RID<class_RID>`, icon\: :ref:`Texture2D<class_Texture2D>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`add_icon_item<class_NativeMenu_method_add_icon_item>`\ (\ rid\: :ref:`RID<class_RID>`, icon\: :ref:`Texture2D<class_Texture2D>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`add_icon_radio_check_item<class_NativeMenu_method_add_icon_radio_check_item>`\ (\ rid\: :ref:`RID<class_RID>`, icon\: :ref:`Texture2D<class_Texture2D>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`add_item<class_NativeMenu_method_add_item>`\ (\ rid\: :ref:`RID<class_RID>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`add_multistate_item<class_NativeMenu_method_add_multistate_item>`\ (\ rid\: :ref:`RID<class_RID>`, label\: :ref:`String<class_String>`, max_states\: :ref:`int<class_int>`, default_state\: :ref:`int<class_int>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`add_radio_check_item<class_NativeMenu_method_add_radio_check_item>`\ (\ rid\: :ref:`RID<class_RID>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`add_separator<class_NativeMenu_method_add_separator>`\ (\ rid\: :ref:`RID<class_RID>`, index\: :ref:`int<class_int>` = -1\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`add_submenu_item<class_NativeMenu_method_add_submenu_item>`\ (\ rid\: :ref:`RID<class_RID>`, label\: :ref:`String<class_String>`, submenu_rid\: :ref:`RID<class_RID>`, tag\: :ref:`Variant<class_Variant>` = null, index\: :ref:`int<class_int>` = -1\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`clear<class_NativeMenu_method_clear>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`RID<class_RID>` | :ref:`create_menu<class_NativeMenu_method_create_menu>`\ (\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`find_item_index_with_tag<class_NativeMenu_method_find_item_index_with_tag>`\ (\ rid\: :ref:`RID<class_RID>`, tag\: :ref:`Variant<class_Variant>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`find_item_index_with_text<class_NativeMenu_method_find_item_index_with_text>`\ (\ rid\: :ref:`RID<class_RID>`, text\: :ref:`String<class_String>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`free_menu<class_NativeMenu_method_free_menu>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Key<enum_@GlobalScope_Key>` | :ref:`get_item_accelerator<class_NativeMenu_method_get_item_accelerator>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Callable<class_Callable>` | :ref:`get_item_callback<class_NativeMenu_method_get_item_callback>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`get_item_count<class_NativeMenu_method_get_item_count>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Texture2D<class_Texture2D>` | :ref:`get_item_icon<class_NativeMenu_method_get_item_icon>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`get_item_indentation_level<class_NativeMenu_method_get_item_indentation_level>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Callable<class_Callable>` | :ref:`get_item_key_callback<class_NativeMenu_method_get_item_key_callback>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`get_item_max_states<class_NativeMenu_method_get_item_max_states>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`int<class_int>` | :ref:`get_item_state<class_NativeMenu_method_get_item_state>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`RID<class_RID>` | :ref:`get_item_submenu<class_NativeMenu_method_get_item_submenu>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Variant<class_Variant>` | :ref:`get_item_tag<class_NativeMenu_method_get_item_tag>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`String<class_String>` | :ref:`get_item_text<class_NativeMenu_method_get_item_text>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`String<class_String>` | :ref:`get_item_tooltip<class_NativeMenu_method_get_item_tooltip>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`float<class_float>` | :ref:`get_minimum_width<class_NativeMenu_method_get_minimum_width>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Callable<class_Callable>` | :ref:`get_popup_close_callback<class_NativeMenu_method_get_popup_close_callback>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Callable<class_Callable>` | :ref:`get_popup_open_callback<class_NativeMenu_method_get_popup_open_callback>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`Vector2<class_Vector2>` | :ref:`get_size<class_NativeMenu_method_get_size>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`RID<class_RID>` | :ref:`get_system_menu<class_NativeMenu_method_get_system_menu>`\ (\ menu_id\: :ref:`SystemMenus<enum_NativeMenu_SystemMenus>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`String<class_String>` | :ref:`get_system_menu_name<class_NativeMenu_method_get_system_menu_name>`\ (\ menu_id\: :ref:`SystemMenus<enum_NativeMenu_SystemMenus>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`has_feature<class_NativeMenu_method_has_feature>`\ (\ feature\: :ref:`Feature<enum_NativeMenu_Feature>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`has_menu<class_NativeMenu_method_has_menu>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`has_system_menu<class_NativeMenu_method_has_system_menu>`\ (\ menu_id\: :ref:`SystemMenus<enum_NativeMenu_SystemMenus>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`is_item_checkable<class_NativeMenu_method_is_item_checkable>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`is_item_checked<class_NativeMenu_method_is_item_checked>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`is_item_disabled<class_NativeMenu_method_is_item_disabled>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`is_item_hidden<class_NativeMenu_method_is_item_hidden>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`is_item_radio_checkable<class_NativeMenu_method_is_item_radio_checkable>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`is_system_menu<class_NativeMenu_method_is_system_menu>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |const| |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`popup<class_NativeMenu_method_popup>`\ (\ rid\: :ref:`RID<class_RID>`, position\: :ref:`Vector2i<class_Vector2i>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`remove_item<class_NativeMenu_method_remove_item>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_accelerator<class_NativeMenu_method_set_item_accelerator>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, keycode\: :ref:`Key<enum_@GlobalScope_Key>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_callback<class_NativeMenu_method_set_item_callback>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, callback\: :ref:`Callable<class_Callable>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_checkable<class_NativeMenu_method_set_item_checkable>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, checkable\: :ref:`bool<class_bool>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_checked<class_NativeMenu_method_set_item_checked>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, checked\: :ref:`bool<class_bool>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_disabled<class_NativeMenu_method_set_item_disabled>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_hidden<class_NativeMenu_method_set_item_hidden>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, hidden\: :ref:`bool<class_bool>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_hover_callbacks<class_NativeMenu_method_set_item_hover_callbacks>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, callback\: :ref:`Callable<class_Callable>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_icon<class_NativeMenu_method_set_item_icon>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_indentation_level<class_NativeMenu_method_set_item_indentation_level>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, level\: :ref:`int<class_int>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_key_callback<class_NativeMenu_method_set_item_key_callback>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, key_callback\: :ref:`Callable<class_Callable>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_max_states<class_NativeMenu_method_set_item_max_states>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, max_states\: :ref:`int<class_int>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_radio_checkable<class_NativeMenu_method_set_item_radio_checkable>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, checkable\: :ref:`bool<class_bool>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_state<class_NativeMenu_method_set_item_state>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, state\: :ref:`int<class_int>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_submenu<class_NativeMenu_method_set_item_submenu>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, submenu_rid\: :ref:`RID<class_RID>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_tag<class_NativeMenu_method_set_item_tag>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, tag\: :ref:`Variant<class_Variant>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_text<class_NativeMenu_method_set_item_text>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_item_tooltip<class_NativeMenu_method_set_item_tooltip>`\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_minimum_width<class_NativeMenu_method_set_minimum_width>`\ (\ rid\: :ref:`RID<class_RID>`, width\: :ref:`float<class_float>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_popup_close_callback<class_NativeMenu_method_set_popup_close_callback>`\ (\ rid\: :ref:`RID<class_RID>`, callback\: :ref:`Callable<class_Callable>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+ | |void| | :ref:`set_popup_open_callback<class_NativeMenu_method_set_popup_open_callback>`\ (\ rid\: :ref:`RID<class_RID>`, callback\: :ref:`Callable<class_Callable>`\ ) |
|
|
|
|
+ +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-section-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-descriptions-group
|
|
|
|
+
|
|
|
|
+Enumerations
|
|
|
|
+------------
|
|
|
|
+
|
|
|
|
+.. _enum_NativeMenu_Feature:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-enumeration
|
|
|
|
+
|
|
|
|
+enum **Feature**:
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_constant_FEATURE_GLOBAL_MENU:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
+
|
|
|
|
+:ref:`Feature<enum_NativeMenu_Feature>` **FEATURE_GLOBAL_MENU** = ``0``
|
|
|
|
+
|
|
|
|
+**NativeMenu** supports native global main menu.
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_constant_FEATURE_POPUP_MENU:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
+
|
|
|
|
+:ref:`Feature<enum_NativeMenu_Feature>` **FEATURE_POPUP_MENU** = ``1``
|
|
|
|
+
|
|
|
|
+**NativeMenu** supports native popup menus.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _enum_NativeMenu_SystemMenus:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-enumeration
|
|
|
|
+
|
|
|
|
+enum **SystemMenus**:
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_constant_INVALID_MENU_ID:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
+
|
|
|
|
+:ref:`SystemMenus<enum_NativeMenu_SystemMenus>` **INVALID_MENU_ID** = ``0``
|
|
|
|
+
|
|
|
|
+Invalid special system menu ID.
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_constant_MAIN_MENU_ID:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
+
|
|
|
|
+:ref:`SystemMenus<enum_NativeMenu_SystemMenus>` **MAIN_MENU_ID** = ``1``
|
|
|
|
+
|
|
|
|
+Global main menu ID.
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_constant_APPLICATION_MENU_ID:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
+
|
|
|
|
+:ref:`SystemMenus<enum_NativeMenu_SystemMenus>` **APPLICATION_MENU_ID** = ``2``
|
|
|
|
+
|
|
|
|
+Application (first menu after "Apple" menu on macOS) menu ID.
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_constant_WINDOW_MENU_ID:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
+
|
|
|
|
+:ref:`SystemMenus<enum_NativeMenu_SystemMenus>` **WINDOW_MENU_ID** = ``3``
|
|
|
|
+
|
|
|
|
+"Window" menu ID (on macOS this menu includes standard window control items and a list of open windows).
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_constant_HELP_MENU_ID:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
+
|
|
|
|
+:ref:`SystemMenus<enum_NativeMenu_SystemMenus>` **HELP_MENU_ID** = ``4``
|
|
|
|
+
|
|
|
|
+"Help" menu ID (on macOS this menu includes help search bar).
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_constant_DOCK_MENU_ID:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
+
|
|
|
|
+:ref:`SystemMenus<enum_NativeMenu_SystemMenus>` **DOCK_MENU_ID** = ``5``
|
|
|
|
+
|
|
|
|
+Dock icon right-click menu ID (on macOS this menu include standard application control items and a list of open windows).
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-section-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-descriptions-group
|
|
|
|
+
|
|
|
|
+Method Descriptions
|
|
|
|
+-------------------
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_add_check_item:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **add_check_item**\ (\ rid\: :ref:`RID<class_RID>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ )
|
|
|
|
+
|
|
|
|
+Adds a new checkable item with text ``label`` to the global menu ``rid``.
|
|
|
|
+
|
|
|
|
+Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
|
|
|
+
|
|
|
|
+An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
|
|
|
|
+
|
|
|
|
+\ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_add_icon_check_item:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **add_icon_check_item**\ (\ rid\: :ref:`RID<class_RID>`, icon\: :ref:`Texture2D<class_Texture2D>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ )
|
|
|
|
+
|
|
|
|
+Adds a new checkable item with text ``label`` and icon ``icon`` to the global menu ``rid``.
|
|
|
|
+
|
|
|
|
+Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
|
|
|
+
|
|
|
|
+An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
|
|
|
|
+
|
|
|
|
+\ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_add_icon_item:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **add_icon_item**\ (\ rid\: :ref:`RID<class_RID>`, icon\: :ref:`Texture2D<class_Texture2D>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ )
|
|
|
|
+
|
|
|
|
+Adds a new item with text ``label`` and icon ``icon`` to the global menu ``rid``.
|
|
|
|
+
|
|
|
|
+Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
|
|
|
+
|
|
|
|
+An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
|
|
|
|
+
|
|
|
|
+\ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_add_icon_radio_check_item:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **add_icon_radio_check_item**\ (\ rid\: :ref:`RID<class_RID>`, icon\: :ref:`Texture2D<class_Texture2D>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ )
|
|
|
|
+
|
|
|
|
+Adds a new radio-checkable item with text ``label`` and icon ``icon`` to the global menu ``rid``.
|
|
|
|
+
|
|
|
|
+Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
|
|
|
+
|
|
|
|
+An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
|
|
|
|
+
|
|
|
|
+\ **Note:** Radio-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_NativeMenu_method_set_item_checked>` for more info on how to control it.
|
|
|
|
+
|
|
|
|
+\ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_add_item:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **add_item**\ (\ rid\: :ref:`RID<class_RID>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ )
|
|
|
|
+
|
|
|
|
+Adds a new item with text ``label`` to the global menu ``rid``.
|
|
|
|
+
|
|
|
|
+Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
|
|
|
+
|
|
|
|
+An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
|
|
|
|
+
|
|
|
|
+\ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_add_multistate_item:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **add_multistate_item**\ (\ rid\: :ref:`RID<class_RID>`, label\: :ref:`String<class_String>`, max_states\: :ref:`int<class_int>`, default_state\: :ref:`int<class_int>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ )
|
|
|
|
+
|
|
|
|
+Adds a new item with text ``label`` to the global menu ``rid``.
|
|
|
|
+
|
|
|
|
+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``.
|
|
|
|
+
|
|
|
|
+Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
|
|
|
+
|
|
|
|
+An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
|
|
|
|
+
|
|
|
|
+\ **Note:** By default, there's no indication of the current item state, it should be changed manually.
|
|
|
|
+
|
|
|
|
+\ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_add_radio_check_item:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **add_radio_check_item**\ (\ rid\: :ref:`RID<class_RID>`, label\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>` = Callable(), key_callback\: :ref:`Callable<class_Callable>` = Callable(), tag\: :ref:`Variant<class_Variant>` = null, accelerator\: :ref:`Key<enum_@GlobalScope_Key>` = 0, index\: :ref:`int<class_int>` = -1\ )
|
|
|
|
+
|
|
|
|
+Adds a new radio-checkable item with text ``label`` to the global menu ``rid``.
|
|
|
|
+
|
|
|
|
+Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
|
|
|
+
|
|
|
|
+An ``accelerator`` can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The ``accelerator`` is generally a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
|
|
|
|
+
|
|
|
|
+\ **Note:** Radio-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_NativeMenu_method_set_item_checked>` for more info on how to control it.
|
|
|
|
+
|
|
|
|
+\ **Note:** The ``callback`` and ``key_callback`` Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to ``tag``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_add_separator:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **add_separator**\ (\ rid\: :ref:`RID<class_RID>`, index\: :ref:`int<class_int>` = -1\ )
|
|
|
|
+
|
|
|
|
+Adds a separator between items to the global menu ``rid``. Separators also occupy an index.
|
|
|
|
+
|
|
|
|
+Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_add_submenu_item:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **add_submenu_item**\ (\ rid\: :ref:`RID<class_RID>`, label\: :ref:`String<class_String>`, submenu_rid\: :ref:`RID<class_RID>`, tag\: :ref:`Variant<class_Variant>` = null, index\: :ref:`int<class_int>` = -1\ )
|
|
|
|
+
|
|
|
|
+Adds an item that will act as a submenu of the global menu ``rid``. The ``submenu_rid`` argument is the RID of the global menu that will be shown when the item is clicked.
|
|
|
|
+
|
|
|
|
+Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_clear:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **clear**\ (\ rid\: :ref:`RID<class_RID>`\ )
|
|
|
|
+
|
|
|
|
+Removes all items from the global menu ``rid``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_create_menu:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`RID<class_RID>` **create_menu**\ (\ )
|
|
|
|
+
|
|
|
|
+Creates a new global menu object.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_find_item_index_with_tag:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **find_item_index_with_tag**\ (\ rid\: :ref:`RID<class_RID>`, tag\: :ref:`Variant<class_Variant>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the index of the item with the specified ``tag``. Index is automatically assigned to each item by the engine. Index can not be set manually.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_find_item_index_with_text:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **find_item_index_with_text**\ (\ rid\: :ref:`RID<class_RID>`, text\: :ref:`String<class_String>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the index of the item with the specified ``text``. Index is automatically assigned to each item by the engine. Index can not be set manually.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_free_menu:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **free_menu**\ (\ rid\: :ref:`RID<class_RID>`\ )
|
|
|
|
+
|
|
|
|
+Frees a global menu object created by this **NativeMenu**.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_accelerator:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`Key<enum_@GlobalScope_Key>` **get_item_accelerator**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+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.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_callback:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`Callable<class_Callable>` **get_item_callback**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the callback of the item at index ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_count:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **get_item_count**\ (\ rid\: :ref:`RID<class_RID>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns number of items in the global menu ``rid``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_icon:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`Texture2D<class_Texture2D>` **get_item_icon**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the icon of the item at index ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_indentation_level:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **get_item_indentation_level**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the horizontal offset of the item at the given ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_key_callback:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`Callable<class_Callable>` **get_item_key_callback**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the callback of the item accelerator at index ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_max_states:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **get_item_max_states**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns number of states of a multistate item. See :ref:`add_multistate_item<class_NativeMenu_method_add_multistate_item>` for details.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_state:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`int<class_int>` **get_item_state**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the state of a multistate item. See :ref:`add_multistate_item<class_NativeMenu_method_add_multistate_item>` for details.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_submenu:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`RID<class_RID>` **get_item_submenu**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the submenu ID of the item at index ``idx``. See :ref:`add_submenu_item<class_NativeMenu_method_add_submenu_item>` for more info on how to add a submenu.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_tag:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`Variant<class_Variant>` **get_item_tag**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the metadata of the specified item, which might be of any type. You can set it with :ref:`set_item_tag<class_NativeMenu_method_set_item_tag>`, which provides a simple way of assigning context data to items.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_text:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`String<class_String>` **get_item_text**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the text of the item at index ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_item_tooltip:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`String<class_String>` **get_item_tooltip**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns the tooltip associated with the specified index ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_minimum_width:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`float<class_float>` **get_minimum_width**\ (\ rid\: :ref:`RID<class_RID>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns global menu minimum width.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_popup_close_callback:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`Callable<class_Callable>` **get_popup_close_callback**\ (\ rid\: :ref:`RID<class_RID>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns global menu close callback.
|
|
|
|
+
|
|
|
|
+b]Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_popup_open_callback:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`Callable<class_Callable>` **get_popup_open_callback**\ (\ rid\: :ref:`RID<class_RID>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns global menu open callback.
|
|
|
|
+
|
|
|
|
+b]Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_size:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`Vector2<class_Vector2>` **get_size**\ (\ rid\: :ref:`RID<class_RID>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns global menu size.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_system_menu:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`RID<class_RID>` **get_system_menu**\ (\ menu_id\: :ref:`SystemMenus<enum_NativeMenu_SystemMenus>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns RID of a special system menu.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_get_system_menu_name:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`String<class_String>` **get_system_menu_name**\ (\ menu_id\: :ref:`SystemMenus<enum_NativeMenu_SystemMenus>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns readable name of a special system menu.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_has_feature:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`bool<class_bool>` **has_feature**\ (\ feature\: :ref:`Feature<enum_NativeMenu_Feature>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns ``true`` if the specified ``feature`` is supported by the current **NativeMenu**, ``false`` otherwise.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_has_menu:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`bool<class_bool>` **has_menu**\ (\ rid\: :ref:`RID<class_RID>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns ``true`` if ``rid`` is valid global menu.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_has_system_menu:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`bool<class_bool>` **has_system_menu**\ (\ menu_id\: :ref:`SystemMenus<enum_NativeMenu_SystemMenus>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns ``true`` if a special system menu is supported.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_is_item_checkable:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`bool<class_bool>` **is_item_checkable**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if it has a checkbox or radio button.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_is_item_checked:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`bool<class_bool>` **is_item_checked**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns ``true`` if the item at index ``idx`` is checked.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_is_item_disabled:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`bool<class_bool>` **is_item_disabled**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked.
|
|
|
|
+
|
|
|
|
+See :ref:`set_item_disabled<class_NativeMenu_method_set_item_disabled>` for more info on how to disable an item.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_is_item_hidden:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`bool<class_bool>` **is_item_hidden**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns ``true`` if the item at index ``idx`` is hidden.
|
|
|
|
+
|
|
|
|
+See :ref:`set_item_hidden<class_NativeMenu_method_set_item_hidden>` for more info on how to hide an item.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_is_item_radio_checkable:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`bool<class_bool>` **is_item_radio_checkable**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Returns ``true`` if the item at index ``idx`` has radio button-style checkability.
|
|
|
|
+
|
|
|
|
+\ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_is_system_menu:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+:ref:`bool<class_bool>` **is_system_menu**\ (\ rid\: :ref:`RID<class_RID>`\ ) |const|
|
|
|
|
+
|
|
|
|
+Return ``true`` is global menu is a special system menu.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_popup:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **popup**\ (\ rid\: :ref:`RID<class_RID>`, position\: :ref:`Vector2i<class_Vector2i>`\ )
|
|
|
|
+
|
|
|
|
+Shows the global menu at ``position`` in the screen coordinates.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_remove_item:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **remove_item**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`\ )
|
|
|
|
+
|
|
|
|
+Removes the item at index ``idx`` from the global menu ``rid``.
|
|
|
|
+
|
|
|
|
+\ **Note:** The indices of items after the removed item will be shifted by one.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_accelerator:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_accelerator**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, keycode\: :ref:`Key<enum_@GlobalScope_Key>`\ )
|
|
|
|
+
|
|
|
|
+Sets the accelerator of the item at index ``idx``. ``keycode`` can be a single :ref:`Key<enum_@GlobalScope_Key>`, or a combination of :ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\ s and :ref:`Key<enum_@GlobalScope_Key>`\ s using bitwise OR such as ``KEY_MASK_CTRL | KEY_A`` (:kbd:`Ctrl + A`).
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_callback:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_callback**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, callback\: :ref:`Callable<class_Callable>`\ )
|
|
|
|
+
|
|
|
|
+Sets the callback of the item at index ``idx``. Callback is emitted when an item is pressed.
|
|
|
|
+
|
|
|
|
+\ **Note:** The ``callback`` Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the ``tag`` parameter when the menu item was created.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_checkable:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_checkable**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, checkable\: :ref:`bool<class_bool>`\ )
|
|
|
|
+
|
|
|
|
+Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the type of the item to plain text.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_checked:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_checked**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, checked\: :ref:`bool<class_bool>`\ )
|
|
|
|
+
|
|
|
|
+Sets the checkstate status of the item at index ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_disabled:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_disabled**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ )
|
|
|
|
+
|
|
|
|
+Enables/disables the item at index ``idx``. When it is disabled, it can't be selected and its action can't be invoked.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_hidden:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_hidden**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, hidden\: :ref:`bool<class_bool>`\ )
|
|
|
|
+
|
|
|
|
+Hides/shows the item at index ``idx``. When it is hidden, an item does not appear in a menu and its action cannot be invoked.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_hover_callbacks:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_hover_callbacks**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, callback\: :ref:`Callable<class_Callable>`\ )
|
|
|
|
+
|
|
|
|
+Sets the callback of the item at index ``idx``. The callback is emitted when an item is hovered.
|
|
|
|
+
|
|
|
|
+\ **Note:** The ``callback`` Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the ``tag`` parameter when the menu item was created.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_icon:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_icon**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ )
|
|
|
|
+
|
|
|
|
+Replaces the :ref:`Texture2D<class_Texture2D>` icon of the specified ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is not supported by macOS "_dock" menu items.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_indentation_level:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_indentation_level**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, level\: :ref:`int<class_int>`\ )
|
|
|
|
+
|
|
|
|
+Sets the horizontal offset of the item at the given ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_key_callback:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_key_callback**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, key_callback\: :ref:`Callable<class_Callable>`\ )
|
|
|
|
+
|
|
|
|
+Sets the callback of the item at index ``idx``. Callback is emitted when its accelerator is activated.
|
|
|
|
+
|
|
|
|
+\ **Note:** The ``key_callback`` Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the ``tag`` parameter when the menu item was created.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_max_states:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_max_states**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, max_states\: :ref:`int<class_int>`\ )
|
|
|
|
+
|
|
|
|
+Sets number of state of a multistate item. See :ref:`add_multistate_item<class_NativeMenu_method_add_multistate_item>` for details.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_radio_checkable:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_radio_checkable**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, checkable\: :ref:`bool<class_bool>`\ )
|
|
|
|
+
|
|
|
|
+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.
|
|
|
|
+
|
|
|
|
+\ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_state:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_state**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, state\: :ref:`int<class_int>`\ )
|
|
|
|
+
|
|
|
|
+Sets the state of a multistate item. See :ref:`add_multistate_item<class_NativeMenu_method_add_multistate_item>` for details.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_submenu:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_submenu**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, submenu_rid\: :ref:`RID<class_RID>`\ )
|
|
|
|
+
|
|
|
|
+Sets the submenu RID of the item at index ``idx``. The submenu is a global menu that would be shown when the item is clicked.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_tag:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_tag**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, tag\: :ref:`Variant<class_Variant>`\ )
|
|
|
|
+
|
|
|
|
+Sets the metadata of an item, which may be of any type. You can later get it with :ref:`get_item_tag<class_NativeMenu_method_get_item_tag>`, which provides a simple way of assigning context data to items.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_text:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_text**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ )
|
|
|
|
+
|
|
|
|
+Sets the text of the item at index ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_item_tooltip:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_item_tooltip**\ (\ rid\: :ref:`RID<class_RID>`, idx\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ )
|
|
|
|
+
|
|
|
|
+Sets the :ref:`String<class_String>` tooltip of the item at the specified index ``idx``.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_minimum_width:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_minimum_width**\ (\ rid\: :ref:`RID<class_RID>`, width\: :ref:`float<class_float>`\ )
|
|
|
|
+
|
|
|
|
+Sets the minimum width of the global menu.
|
|
|
|
+
|
|
|
|
+\ **Note:** This method is implemented only on macOS.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_popup_close_callback:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_popup_close_callback**\ (\ rid\: :ref:`RID<class_RID>`, callback\: :ref:`Callable<class_Callable>`\ )
|
|
|
|
+
|
|
|
|
+Registers callable to emit when the menu is about to show.
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
+
|
|
|
|
+----
|
|
|
|
+
|
|
|
|
+.. _class_NativeMenu_method_set_popup_open_callback:
|
|
|
|
+
|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
+
|
|
|
|
+|void| **set_popup_open_callback**\ (\ rid\: :ref:`RID<class_RID>`, callback\: :ref:`Callable<class_Callable>`\ )
|
|
|
|
+
|
|
|
|
+Registers callable to emit when the menu is about to closed.
|
|
|
|
+
|
|
|
|
+.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
|
|
+.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
|
|
+.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
|
|
+.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
|
|
|
|
+.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|
|
|
|
+.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|
|
|
|
+.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|
|
|
|
+.. |void| replace:: :abbr:`void (No return value.)`
|