.. default-domain:: py .. highlight:: py .. currentmodule:: UI Dropdown ======== .. class:: Dropdown A control for choosing one of a list of options, which are shown when it is clicked. Added to a :class:`Canvas` or a :class:`Panel`. | Base class: :class:`InputControl` .. container:: inherited-members .. rubric:: Inherited Members * From :class:`InputControl`: :attr:`~InputControl.changed` * From :class:`Control`: :attr:`~Control.interactable`, :attr:`~Control.color`, :attr:`~Control.tooltip` * From :class:`Object`: :attr:`~Object.rect_transform`, :attr:`~Object.layout_element`, :attr:`~Object.visible`, :meth:`~Object.remove` .. attribute:: options The options that the dropdown offers. :Attribute: Can be read or written :rtype: list(str) .. note:: Setting the options resets the selection to the first of them, or to nothing when the list is empty. .. attribute:: selected_index The position in :attr:`Dropdown.options` of the option that is chosen. :Attribute: Can be read or written :rtype: int .. note:: Zero while the dropdown has no options, as there is nothing to choose.