mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
classref: Sync with current master branch (bfa866c)
This commit is contained in:
@@ -410,6 +410,8 @@ enum **Feature**:
|
||||
|
||||
:ref:`Feature<enum_DisplayServer_Feature>` **FEATURE_GLOBAL_MENU** = ``0``
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Display server supports global menu. This allows the application to display its menu items in the operating system's top bar. **macOS**
|
||||
|
||||
.. _class_DisplayServer_constant_FEATURE_SUBWINDOWS:
|
||||
@@ -1620,9 +1622,9 @@ Removes the application status indicator.
|
||||
|
||||
:ref:`Error<enum_@GlobalScope_Error>` **dialog_input_text**\ (\ title\: :ref:`String<class_String>`, description\: :ref:`String<class_String>`, existing_text\: :ref:`String<class_String>`, callback\: :ref:`Callable<class_Callable>`\ )
|
||||
|
||||
Shows a text input dialog which uses the operating system's native look-and-feel. ``callback`` will be called with a :ref:`String<class_String>` argument equal to the text field's contents when the dialog is closed for any reason.
|
||||
Shows a text input dialog which uses the operating system's native look-and-feel. ``callback`` should accept a single :ref:`String<class_String>` parameter which contains the text field's contents.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
\ **Note:** This method is implemented only on macOS and Windows.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -1634,9 +1636,9 @@ Shows a text input dialog which uses the operating system's native look-and-feel
|
||||
|
||||
:ref:`Error<enum_@GlobalScope_Error>` **dialog_show**\ (\ title\: :ref:`String<class_String>`, description\: :ref:`String<class_String>`, buttons\: :ref:`PackedStringArray<class_PackedStringArray>`, callback\: :ref:`Callable<class_Callable>`\ )
|
||||
|
||||
Shows a text dialog which uses the operating system's native look-and-feel. ``callback`` will be called when the dialog is closed for any reason.
|
||||
Shows a text dialog which uses the operating system's native look-and-feel. ``callback`` should accept a single :ref:`int<class_int>` parameter which corresponds to the index of the pressed button.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
\ **Note:** This method is implemented only on macOS and Windows.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
@@ -1664,6 +1666,8 @@ Allows the ``process_id`` PID to steal focus from this window. In other words, t
|
||||
|
||||
Displays OS native dialog for selecting files or directories in the file system.
|
||||
|
||||
Each filter string in the ``filters`` array should be formatted like this: ``*.txt,*.doc;Text Files``. The description text of the filter is optional and can be omitted. See also :ref:`FileDialog.filters<class_FileDialog_property_filters>`.
|
||||
|
||||
Callbacks have the following arguments: ``status: bool, selected_paths: PackedStringArray, selected_filter_index: int``.
|
||||
|
||||
\ **Note:** This method is implemented if the display server has the :ref:`FEATURE_NATIVE_DIALOG<class_DisplayServer_constant_FEATURE_NATIVE_DIALOG>` feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS.
|
||||
@@ -1688,6 +1692,8 @@ Callbacks have the following arguments: ``status: bool, selected_paths: PackedSt
|
||||
|
||||
Displays OS native dialog for selecting files or directories in the file system with additional user selectable options.
|
||||
|
||||
Each filter string in the ``filters`` array should be formatted like this: ``*.txt,*.doc;Text Files``. The description text of the filter is optional and can be omitted. See also :ref:`FileDialog.filters<class_FileDialog_property_filters>`.
|
||||
|
||||
\ ``options`` is array of :ref:`Dictionary<class_Dictionary>`\ s with the following keys:
|
||||
|
||||
- ``"name"`` - option's name :ref:`String<class_String>`.
|
||||
@@ -1897,6 +1903,8 @@ Returns the list of Godot window IDs belonging to this process.
|
||||
|
||||
:ref:`int<class_int>` **global_menu_add_check_item**\ (\ menu_root\: :ref:`String<class_String>`, 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\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Adds a new checkable item with text ``label`` to the global menu with ID ``menu_root``.
|
||||
|
||||
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
||||
@@ -1927,6 +1935,8 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that
|
||||
|
||||
:ref:`int<class_int>` **global_menu_add_icon_check_item**\ (\ menu_root\: :ref:`String<class_String>`, 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\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Adds a new checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
|
||||
|
||||
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
||||
@@ -1957,6 +1967,8 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that
|
||||
|
||||
:ref:`int<class_int>` **global_menu_add_icon_item**\ (\ menu_root\: :ref:`String<class_String>`, 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\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Adds a new item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
|
||||
|
||||
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
||||
@@ -1987,6 +1999,8 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that
|
||||
|
||||
:ref:`int<class_int>` **global_menu_add_icon_radio_check_item**\ (\ menu_root\: :ref:`String<class_String>`, 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\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Adds a new radio-checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
|
||||
|
||||
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
||||
@@ -2019,6 +2033,8 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that
|
||||
|
||||
:ref:`int<class_int>` **global_menu_add_item**\ (\ menu_root\: :ref:`String<class_String>`, 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\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
|
||||
|
||||
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
||||
@@ -2049,6 +2065,8 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that
|
||||
|
||||
:ref:`int<class_int>` **global_menu_add_multistate_item**\ (\ menu_root\: :ref:`String<class_String>`, 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\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
|
||||
|
||||
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``.
|
||||
@@ -2083,6 +2101,8 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that
|
||||
|
||||
:ref:`int<class_int>` **global_menu_add_radio_check_item**\ (\ menu_root\: :ref:`String<class_String>`, 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\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Adds a new radio-checkable item with text ``label`` to the global menu with ID ``menu_root``.
|
||||
|
||||
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
||||
@@ -2115,6 +2135,8 @@ An ``accelerator`` can optionally be defined, which is a keyboard shortcut that
|
||||
|
||||
:ref:`int<class_int>` **global_menu_add_separator**\ (\ menu_root\: :ref:`String<class_String>`, index\: :ref:`int<class_int>` = -1\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Adds a separator between items to the global menu with ID ``menu_root``. Separators also occupy an index.
|
||||
|
||||
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
|
||||
@@ -2141,6 +2163,8 @@ Returns index of the inserted item, it's not guaranteed to be the same as ``inde
|
||||
|
||||
:ref:`int<class_int>` **global_menu_add_submenu_item**\ (\ menu_root\: :ref:`String<class_String>`, label\: :ref:`String<class_String>`, submenu\: :ref:`String<class_String>`, index\: :ref:`int<class_int>` = -1\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Adds an item that will act as a submenu of the global menu ``menu_root``. The ``submenu`` argument is the ID of the global menu root 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.
|
||||
@@ -2167,6 +2191,8 @@ Returns index of the inserted item, it's not guaranteed to be the same as ``inde
|
||||
|
||||
|void| **global_menu_clear**\ (\ menu_root\: :ref:`String<class_String>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Removes all items from the global menu with ID ``menu_root``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2191,6 +2217,8 @@ Removes all items from the global menu with ID ``menu_root``.
|
||||
|
||||
:ref:`Key<enum_@GlobalScope_Key>` **global_menu_get_item_accelerator**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2205,6 +2233,8 @@ Returns the accelerator of the item at index ``idx``. Accelerators are special c
|
||||
|
||||
:ref:`Callable<class_Callable>` **global_menu_get_item_callback**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns the callback of the item at index ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2219,6 +2249,8 @@ Returns the callback of the item at index ``idx``.
|
||||
|
||||
:ref:`int<class_int>` **global_menu_get_item_count**\ (\ menu_root\: :ref:`String<class_String>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns number of items in the global menu with ID ``menu_root``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2233,6 +2265,8 @@ Returns number of items in the global menu with ID ``menu_root``.
|
||||
|
||||
:ref:`Texture2D<class_Texture2D>` **global_menu_get_item_icon**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns the icon of the item at index ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2247,6 +2281,8 @@ Returns the icon of the item at index ``idx``.
|
||||
|
||||
:ref:`int<class_int>` **global_menu_get_item_indentation_level**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns the horizontal offset of the item at the given ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2261,6 +2297,8 @@ Returns the horizontal offset of the item at the given ``idx``.
|
||||
|
||||
:ref:`int<class_int>` **global_menu_get_item_index_from_tag**\ (\ menu_root\: :ref:`String<class_String>`, tag\: :ref:`Variant<class_Variant>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2275,6 +2313,8 @@ Returns the index of the item with the specified ``tag``. Index is automatically
|
||||
|
||||
:ref:`int<class_int>` **global_menu_get_item_index_from_text**\ (\ menu_root\: :ref:`String<class_String>`, text\: :ref:`String<class_String>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2289,6 +2329,8 @@ Returns the index of the item with the specified ``text``. Index is automaticall
|
||||
|
||||
:ref:`Callable<class_Callable>` **global_menu_get_item_key_callback**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns the callback of the item accelerator at index ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2303,6 +2345,8 @@ Returns the callback of the item accelerator at index ``idx``.
|
||||
|
||||
:ref:`int<class_int>` **global_menu_get_item_max_states**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns number of states of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2317,6 +2361,8 @@ Returns number of states of a multistate item. See :ref:`global_menu_add_multist
|
||||
|
||||
:ref:`int<class_int>` **global_menu_get_item_state**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2331,6 +2377,8 @@ Returns the state of a multistate item. See :ref:`global_menu_add_multistate_ite
|
||||
|
||||
:ref:`String<class_String>` **global_menu_get_item_submenu**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns the submenu ID of the item at index ``idx``. See :ref:`global_menu_add_submenu_item<class_DisplayServer_method_global_menu_add_submenu_item>` for more info on how to add a submenu.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2345,6 +2393,8 @@ Returns the submenu ID of the item at index ``idx``. See :ref:`global_menu_add_s
|
||||
|
||||
:ref:`Variant<class_Variant>` **global_menu_get_item_tag**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns the metadata of the specified item, which might be of any type. You can set it with :ref:`global_menu_set_item_tag<class_DisplayServer_method_global_menu_set_item_tag>`, which provides a simple way of assigning context data to items.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2359,6 +2409,8 @@ Returns the metadata of the specified item, which might be of any type. You can
|
||||
|
||||
:ref:`String<class_String>` **global_menu_get_item_text**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns the text of the item at index ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2373,6 +2425,8 @@ Returns the text of the item at index ``idx``.
|
||||
|
||||
:ref:`String<class_String>` **global_menu_get_item_tooltip**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns the tooltip associated with the specified index ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2387,6 +2441,8 @@ Returns the tooltip associated with the specified index ``idx``.
|
||||
|
||||
:ref:`Dictionary<class_Dictionary>` **global_menu_get_system_menu_roots**\ (\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns Dictionary of supported system menu IDs and names.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2401,6 +2457,8 @@ Returns Dictionary of supported system menu IDs and names.
|
||||
|
||||
:ref:`bool<class_bool>` **global_menu_is_item_checkable**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2415,6 +2473,8 @@ Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if
|
||||
|
||||
:ref:`bool<class_bool>` **global_menu_is_item_checked**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns ``true`` if the item at index ``idx`` is checked.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2429,6 +2489,8 @@ Returns ``true`` if the item at index ``idx`` is checked.
|
||||
|
||||
:ref:`bool<class_bool>` **global_menu_is_item_disabled**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_set_item_disabled>` for more info on how to disable an item.
|
||||
@@ -2445,6 +2507,8 @@ See :ref:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_s
|
||||
|
||||
:ref:`bool<class_bool>` **global_menu_is_item_hidden**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Returns ``true`` if the item at index ``idx`` is hidden.
|
||||
|
||||
See :ref:`global_menu_set_item_hidden<class_DisplayServer_method_global_menu_set_item_hidden>` for more info on how to hide an item.
|
||||
@@ -2461,6 +2525,8 @@ See :ref:`global_menu_set_item_hidden<class_DisplayServer_method_global_menu_set
|
||||
|
||||
:ref:`bool<class_bool>` **global_menu_is_item_radio_checkable**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ ) |const|
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2477,6 +2543,8 @@ Returns ``true`` if the item at index ``idx`` has radio button-style checkabilit
|
||||
|
||||
|void| **global_menu_remove_item**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Removes the item at index ``idx`` from the global menu ``menu_root``.
|
||||
|
||||
\ **Note:** The indices of items after the removed item will be shifted by one.
|
||||
@@ -2493,6 +2561,8 @@ Removes the item at index ``idx`` from the global menu ``menu_root``.
|
||||
|
||||
|void| **global_menu_set_item_accelerator**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, keycode\: :ref:`Key<enum_@GlobalScope_Key>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2507,6 +2577,8 @@ Sets the accelerator of the item at index ``idx``. ``keycode`` can be a single :
|
||||
|
||||
|void| **global_menu_set_item_callback**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, callback\: :ref:`Callable<class_Callable>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2523,6 +2595,8 @@ Sets the callback of the item at index ``idx``. Callback is emitted when an item
|
||||
|
||||
|void| **global_menu_set_item_checkable**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, checkable\: :ref:`bool<class_bool>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2537,6 +2611,8 @@ Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the ty
|
||||
|
||||
|void| **global_menu_set_item_checked**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, checked\: :ref:`bool<class_bool>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Sets the checkstate status of the item at index ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2551,6 +2627,8 @@ Sets the checkstate status of the item at index ``idx``.
|
||||
|
||||
|void| **global_menu_set_item_disabled**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2565,6 +2643,8 @@ Enables/disables the item at index ``idx``. When it is disabled, it can't be sel
|
||||
|
||||
|void| **global_menu_set_item_hidden**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, hidden\: :ref:`bool<class_bool>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2579,6 +2659,8 @@ Hides/shows the item at index ``idx``. When it is hidden, an item does not appea
|
||||
|
||||
|void| **global_menu_set_item_hover_callbacks**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, callback\: :ref:`Callable<class_Callable>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2595,6 +2677,8 @@ Sets the callback of the item at index ``idx``. The callback is emitted when an
|
||||
|
||||
|void| **global_menu_set_item_icon**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Replaces the :ref:`Texture2D<class_Texture2D>` icon of the specified ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2611,6 +2695,8 @@ Replaces the :ref:`Texture2D<class_Texture2D>` icon of the specified ``idx``.
|
||||
|
||||
|void| **global_menu_set_item_indentation_level**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, level\: :ref:`int<class_int>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Sets the horizontal offset of the item at the given ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2625,6 +2711,8 @@ Sets the horizontal offset of the item at the given ``idx``.
|
||||
|
||||
|void| **global_menu_set_item_key_callback**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, key_callback\: :ref:`Callable<class_Callable>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2641,6 +2729,8 @@ Sets the callback of the item at index ``idx``. Callback is emitted when its acc
|
||||
|
||||
|void| **global_menu_set_item_max_states**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, max_states\: :ref:`int<class_int>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Sets number of state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2655,6 +2745,8 @@ Sets number of state of a multistate item. See :ref:`global_menu_add_multistate_
|
||||
|
||||
|void| **global_menu_set_item_radio_checkable**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, checkable\: :ref:`bool<class_bool>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
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.
|
||||
@@ -2671,6 +2763,8 @@ Sets the type of the item at the specified index ``idx`` to radio button. If ``f
|
||||
|
||||
|void| **global_menu_set_item_state**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, state\: :ref:`int<class_int>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Sets the state of a multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2685,6 +2779,8 @@ Sets the state of a multistate item. See :ref:`global_menu_add_multistate_item<c
|
||||
|
||||
|void| **global_menu_set_item_submenu**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, submenu\: :ref:`String<class_String>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Sets the submenu of the item at index ``idx``. The submenu is the ID of a global menu root that would be shown when the item is clicked.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2699,6 +2795,8 @@ Sets the submenu of the item at index ``idx``. The submenu is the ID of a global
|
||||
|
||||
|void| **global_menu_set_item_tag**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, tag\: :ref:`Variant<class_Variant>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Sets the metadata of an item, which may be of any type. You can later get it with :ref:`global_menu_get_item_tag<class_DisplayServer_method_global_menu_get_item_tag>`, which provides a simple way of assigning context data to items.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2713,6 +2811,8 @@ Sets the metadata of an item, which may be of any type. You can later get it wit
|
||||
|
||||
|void| **global_menu_set_item_text**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, text\: :ref:`String<class_String>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Sets the text of the item at index ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2727,6 +2827,8 @@ Sets the text of the item at index ``idx``.
|
||||
|
||||
|void| **global_menu_set_item_tooltip**\ (\ menu_root\: :ref:`String<class_String>`, idx\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Sets the :ref:`String<class_String>` tooltip of the item at the specified index ``idx``.
|
||||
|
||||
\ **Note:** This method is implemented only on macOS.
|
||||
@@ -2741,6 +2843,8 @@ Sets the :ref:`String<class_String>` tooltip of the item at the specified index
|
||||
|
||||
|void| **global_menu_set_popup_callbacks**\ (\ menu_root\: :ref:`String<class_String>`, open_callback\: :ref:`Callable<class_Callable>`, close_callback\: :ref:`Callable<class_Callable>`\ )
|
||||
|
||||
**Deprecated:** Use :ref:`NativeMenu<class_NativeMenu>` or :ref:`PopupMenu<class_PopupMenu>` instead.
|
||||
|
||||
Registers callables to emit when the menu is respectively about to show or closed.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
@@ -3225,6 +3329,8 @@ Sets the ``screen``'s ``orientation``. See also :ref:`screen_get_orientation<cla
|
||||
|
||||
Sets the window icon (usually displayed in the top-left corner) with an :ref:`Image<class_Image>`. To use icons in the operating system's native format, use :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` instead.
|
||||
|
||||
\ **Note:** Requires support for :ref:`FEATURE_ICON<class_DisplayServer_constant_FEATURE_ICON>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
@@ -3237,6 +3343,8 @@ Sets the window icon (usually displayed in the top-left corner) with an :ref:`Im
|
||||
|
||||
Sets the window icon (usually displayed in the top-left corner) in the operating system's *native* format. The file at ``filename`` must be in ``.ico`` format on Windows or ``.icns`` on macOS. By using specially crafted ``.ico`` or ``.icns`` icons, :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` allows specifying different icons depending on the size the icon is displayed at. This size is determined by the operating system and user preferences (including the display scale factor). To use icons in other formats, use :ref:`set_icon<class_DisplayServer_method_set_icon>` instead.
|
||||
|
||||
\ **Note:** Requires support for :ref:`FEATURE_NATIVE_ICON<class_DisplayServer_constant_FEATURE_NATIVE_ICON>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user