U
    P’“eö  ã                   @   sJ   d Z dZddlmZ ddlmZmZmZ ddlm	Z	 G dd„ de	eƒZ
dS )	a;  
Button
======

.. image:: images/button.jpg
    :align: right

The :class:`Button` is a :class:`~kivy.uix.label.Label` with associated actions
that are triggered when the button is pressed (or released after a
click/touch). To configure the button, the same properties (padding,
font_size, etc) and
:ref:`sizing system <kivy-uix-label-sizing-and-text-content>`
are used as for the :class:`~kivy.uix.label.Label` class::

    button = Button(text='Hello world', font_size=14)

To attach a callback when the button is pressed (clicked/touched), use
:class:`~kivy.uix.widget.Widget.bind`::

    def callback(instance):
        print('The button <%s> is being pressed' % instance.text)

    btn1 = Button(text='Hello world 1')
    btn1.bind(on_press=callback)
    btn2 = Button(text='Hello world 2')
    btn2.bind(on_press=callback)

If you want to be notified every time the button state changes, you can bind
to the :attr:`Button.state` property::

    def callback(instance, value):
        print('My button <%s> state is <%s>' % (instance, value))
    btn1 = Button(text='Hello world 1')
    btn1.bind(state=callback)

Kv Example::

    Button:
        text: 'press me'
        on_press: print("ouch! More gently please")
        on_release: print("ahhh")
        on_state:
            print("my current state is {}".format(self.state))

)ÚButtoné    )ÚLabel)ÚStringPropertyÚListPropertyÚColorProperty)ÚButtonBehaviorc                   @   sP   e Zd ZdZeddddgƒZedƒZedƒZedƒZ	edƒZ
eddddgƒZdS )	r   zÔButton class, see module documentation for more information.

    .. versionchanged:: 1.8.0
        The behavior / logic of the button has been moved to
        :class:`~kivy.uix.behaviors.ButtonBehaviors`.

    é   z'atlas://data/images/defaulttheme/buttonz/atlas://data/images/defaulttheme/button_pressedz0atlas://data/images/defaulttheme/button_disabledz8atlas://data/images/defaulttheme/button_disabled_pressedé   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Zbackground_colorr   Zbackground_normalZbackground_downZbackground_disabled_normalZbackground_disabled_downr   Zborder© r   r   ú3/tmp/pip-unpacked-wheel-xzebddm3/kivy/uix/button.pyr   6   s    ÿÿÿÿr   N)r   Ú__all__Zkivy.uix.labelr   Zkivy.propertiesr   r   r   Zkivy.uix.behaviorsr   r   r   r   r   r   Ú<module>   s
   .