.. 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/docs/gdscript/doc/classes/OptionButton.xml. .. _class_OptionButton: OptionButton ============ **Inherits:** :ref:`Button` **<** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` .. container:: contribute There is currently no description for this class. Please help us by :ref:`contributing one `! .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`ActionMode` | action_mode | ``0`` (overrides :ref:`BaseButton`) | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`HorizontalAlignment` | alignment | ``0`` (overrides :ref:`Button`) | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`allow_reselect` | ``false`` | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`fit_to_longest_item` | ``true`` | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`int` | :ref:`item_count` | ``0`` | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`int` | :ref:`selected` | ``-1`` | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`bool` | toggle_mode | ``true`` (overrides :ref:`BaseButton`) | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_icon_item` **(** :ref:`Texture2D` texture, :ref:`String` label, :ref:`int` id=-1 **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_item` **(** :ref:`String` label, :ref:`int` id=-1 **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_separator` **(** :ref:`String` text="" **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture2D` | :ref:`get_item_icon` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_item_id` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_item_index` **(** :ref:`int` id **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_item_metadata` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_item_text` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_item_tooltip` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PopupMenu` | :ref:`get_popup` **(** **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selectable_item` **(** :ref:`bool` from_last=false **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selected_id` **(** **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_selected_metadata` **(** **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_selectable_items` **(** **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_item_disabled` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_item_separator` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_item` **(** :ref:`int` idx **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select` **(** :ref:`int` idx **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_disable_shortcuts` **(** :ref:`bool` disabled **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_disabled` **(** :ref:`int` idx, :ref:`bool` disabled **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_icon` **(** :ref:`int` idx, :ref:`Texture2D` texture **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_id` **(** :ref:`int` idx, :ref:`int` id **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_metadata` **(** :ref:`int` idx, :ref:`Variant` metadata **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_text` **(** :ref:`int` idx, :ref:`String` text **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_tooltip` **(** :ref:`int` idx, :ref:`String` tooltip **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`show_popup` **(** **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Theme Properties ---------------- .. table:: :widths: auto +-----------------------------------+-------------------------------------------------------------------------+-------+ | :ref:`int` | :ref:`arrow_margin` | ``4`` | +-----------------------------------+-------------------------------------------------------------------------+-------+ | :ref:`int` | :ref:`modulate_arrow` | ``0`` | +-----------------------------------+-------------------------------------------------------------------------+-------+ | :ref:`Texture2D` | :ref:`arrow` | | +-----------------------------------+-------------------------------------------------------------------------+-------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_OptionButton_signal_item_focused: .. rst-class:: classref-signal **item_focused** **(** :ref:`int` index **)** .. container:: contribute There is currently no description for this signal. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_signal_item_selected: .. rst-class:: classref-signal **item_selected** **(** :ref:`int` index **)** .. container:: contribute There is currently no description for this signal. Please help us by :ref:`contributing one `! .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_OptionButton_property_allow_reselect: .. rst-class:: classref-property :ref:`bool` **allow_reselect** = ``false`` .. rst-class:: classref-property-setget - void **set_allow_reselect** **(** :ref:`bool` value **)** - :ref:`bool` **get_allow_reselect** **(** **)** .. container:: contribute There is currently no description for this property. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_property_fit_to_longest_item: .. rst-class:: classref-property :ref:`bool` **fit_to_longest_item** = ``true`` .. rst-class:: classref-property-setget - void **set_fit_to_longest_item** **(** :ref:`bool` value **)** - :ref:`bool` **is_fit_to_longest_item** **(** **)** .. container:: contribute There is currently no description for this property. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_property_item_count: .. rst-class:: classref-property :ref:`int` **item_count** = ``0`` .. rst-class:: classref-property-setget - void **set_item_count** **(** :ref:`int` value **)** - :ref:`int` **get_item_count** **(** **)** .. container:: contribute There is currently no description for this property. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_property_selected: .. rst-class:: classref-property :ref:`int` **selected** = ``-1`` .. rst-class:: classref-property-setget - :ref:`int` **get_selected** **(** **)** .. container:: contribute There is currently no description for this property. Please help us by :ref:`contributing one `! .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_OptionButton_method_add_icon_item: .. rst-class:: classref-method void **add_icon_item** **(** :ref:`Texture2D` texture, :ref:`String` label, :ref:`int` id=-1 **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_add_item: .. rst-class:: classref-method void **add_item** **(** :ref:`String` label, :ref:`int` id=-1 **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_add_separator: .. rst-class:: classref-method void **add_separator** **(** :ref:`String` text="" **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_clear: .. rst-class:: classref-method void **clear** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_icon: .. rst-class:: classref-method :ref:`Texture2D` **get_item_icon** **(** :ref:`int` idx **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_id: .. rst-class:: classref-method :ref:`int` **get_item_id** **(** :ref:`int` idx **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_index: .. rst-class:: classref-method :ref:`int` **get_item_index** **(** :ref:`int` id **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_metadata: .. rst-class:: classref-method :ref:`Variant` **get_item_metadata** **(** :ref:`int` idx **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_text: .. rst-class:: classref-method :ref:`String` **get_item_text** **(** :ref:`int` idx **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_tooltip: .. rst-class:: classref-method :ref:`String` **get_item_tooltip** **(** :ref:`int` idx **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_popup: .. rst-class:: classref-method :ref:`PopupMenu` **get_popup** **(** **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_selectable_item: .. rst-class:: classref-method :ref:`int` **get_selectable_item** **(** :ref:`bool` from_last=false **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_selected_id: .. rst-class:: classref-method :ref:`int` **get_selected_id** **(** **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_selected_metadata: .. rst-class:: classref-method :ref:`Variant` **get_selected_metadata** **(** **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_has_selectable_items: .. rst-class:: classref-method :ref:`bool` **has_selectable_items** **(** **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_is_item_disabled: .. rst-class:: classref-method :ref:`bool` **is_item_disabled** **(** :ref:`int` idx **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_is_item_separator: .. rst-class:: classref-method :ref:`bool` **is_item_separator** **(** :ref:`int` idx **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_remove_item: .. rst-class:: classref-method void **remove_item** **(** :ref:`int` idx **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_select: .. rst-class:: classref-method void **select** **(** :ref:`int` idx **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_disable_shortcuts: .. rst-class:: classref-method void **set_disable_shortcuts** **(** :ref:`bool` disabled **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_disabled: .. rst-class:: classref-method void **set_item_disabled** **(** :ref:`int` idx, :ref:`bool` disabled **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_icon: .. rst-class:: classref-method void **set_item_icon** **(** :ref:`int` idx, :ref:`Texture2D` texture **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_id: .. rst-class:: classref-method void **set_item_id** **(** :ref:`int` idx, :ref:`int` id **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_metadata: .. rst-class:: classref-method void **set_item_metadata** **(** :ref:`int` idx, :ref:`Variant` metadata **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_text: .. rst-class:: classref-method void **set_item_text** **(** :ref:`int` idx, :ref:`String` text **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_tooltip: .. rst-class:: classref-method void **set_item_tooltip** **(** :ref:`int` idx, :ref:`String` tooltip **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_show_popup: .. rst-class:: classref-method void **show_popup** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Theme Property Descriptions --------------------------- .. _class_OptionButton_theme_constant_arrow_margin: .. rst-class:: classref-themeproperty :ref:`int` **arrow_margin** = ``4`` .. container:: contribute There is currently no description for this theme property. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_constant_modulate_arrow: .. rst-class:: classref-themeproperty :ref:`int` **modulate_arrow** = ``0`` .. container:: contribute There is currently no description for this theme property. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_icon_arrow: .. rst-class:: classref-themeproperty :ref:`Texture2D` **arrow** .. container:: contribute There is currently no description for this theme property. Please help us by :ref:`contributing one `! .. |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.)`