
    ^hl                         S r SSKJr  SSKJr  SSKJrJrJr  SSK	J
r
  SSKJr  SSKJrJr  SS	KJrJrJrJrJrJr  \ " S
 S\\
5      5       r\ " S S\\
5      5       rg)zButton class.

Represents a button in the frontend using a widget.  Allows user to listen for
click events on the button and trigger backend code when the clicks are fired.
   )deprecation)	DOMWidget)CallbackDispatcherregisterwidget_serialization)
CoreWidget)Style)ColorInstanceDict    )UnicodeBoolCaselessStrEnumInstancevalidatedefaultc                      \ rS rSrSr\" S5      R                  SS9r\" SSSS9R                  SS9r	\" SSS	S9R                  SS9r
\" SSS
S9R                  SS9r\" SSSS9R                  SS9r\" SSSS9R                  SS9r\" SSSS9R                  SS9r\" SSSS9R                  SS9r\" SSSS9R                  SS9rSrg)ButtonStyle   zButton style widget.ButtonStyleModelTsyncNzColor of the button)
allow_nonehelpzButton text font family.zButton text font size.zButton text font style.zButton text font variant.zButton text font weight.zButton text color.zButton text decoration. )__name__
__module____qualname____firstlineno____doc__r   tag_model_namer
   button_colorfont_family	font_size
font_stylefont_variantfont_weight
text_colortext_decoration__static_attributes__r       Z/home/james-whalen/.local/lib/python3.13/site-packages/ipywidgets/widgets/widget_button.pyr   r      s   ,-11t1<K$5JKOOUYOZL$46PQUU[_U`K4LMQQW[Q\I$5NOSSY]S^J4D7RSWW]aWbL$46PQUU[_U`K$5IJNNTXNYJdt:STXX^bXcOr,   r   c                     ^  \ rS rSrSr\" S5      R                  SS9r\" S5      R                  SS9r\" SS9R                  SS9r	\
" S	S
S9R                  SS9r\" SSS9R                  SS9r\" / SQSSS9R                  SS9r\" \5      R                  " SSS0\D6rU 4S jr\" S5      S 5       rSS jrS rS rSrU =r$ )Button"   a^  Button widget.

This widget has an `on_click` method that allows you to listen for the
user clicking on the button.  The click event itself is stateless.

Parameters
----------
description: str
   description displayed on the button
icon: str
   font-awesome icon names, without the 'fa-' prefix
disabled: bool
   whether user interaction is enabled

ButtonViewTr   ButtonModelzButton label.)r   FzEnable or disable user changes. z2Font-awesome icon names, without the 'fa-' prefix.)primarysuccessinfowarningdangerr3   z(Use a predefined styling for the button.)valuesdefault_valuer   r   c                 z   > [         TU ]  " S0 UD6  [        5       U l        U R	                  U R
                  5        g )Nr   )super__init__r   _click_handlerson_msg_handle_button_msg)selfkwargs	__class__s     r-   r=   Button.__init__?   s0    "6"13D++,r,   iconc                 X    US   nSU;   a  [        S/ SQS9  UR                  SS5      nU$ )zStrip 'fa-' if necessary'valuezfa-z}icons names no longer need 'fa-', just use the class names themselves (for example, 'gear spin' instead of 'fa-gear fa-spin'))zipywidgets/widgets/ztraitlets/traitlets.pyz/contextlib.py)internalr3   )r   replace)rA   proposalrG   s      r-   _validate_iconButton._validate_iconD   s>     !E> jXZ MM%,Er,   c                 6    U R                   R                  XS9  g)a  Register a callback to execute when the button is clicked.

The callback will be called with one argument, the clicked button
widget instance.

Parameters
----------
remove: bool (optional)
    Set to true to remove the callback from the list of callbacks.
)removeN)r>   register_callback)rA   callbackrN   s      r-   on_clickButton.on_clickO   s     	..x.Gr,   c                 &    U R                  U 5        g)zxProgrammatically trigger a click event.

This will call the callbacks registered to the clicked button
widget instance.
Nr>   )rA   s    r-   clickButton.click\   s     	T"r,   c                 R    UR                  SS5      S:X  a  U R                  5         gg)z^Handle a msg from the front-end.

Parameters
----------
content: dict
    Content of the msg.
eventr3   rU   N)getrU   )rA   _contentbufferss       r-   r@   Button._handle_button_msgd   s%     ;;w#w.JJL /r,   rT   r   )F)r   r   r   r   r    r   r!   
_view_namer"   descriptionr   disabledrE   r   button_styler   r   r   styler=   r   rK   rQ   rU   r@   r+   __classcell__)rC   s   @r-   r/   r/   "   s     &***5J-(,,$,7K/333>KE ABFFDFQH2PQUU[_U`D"FVX;==@SdS^  %))LtL7KLE-
 f H#	 	r,   r/   N)r    utilsr   	domwidgetr   widgetr   r   r   widget_corer   widget_styler	   trait_typesr
   r   	traitletsr   r   r   r   r   r   r   r/   r   r,   r-   <module>rk      sg       F F #  , Q Q 

d% 
d 

d 
JY
 J 
Jr,   