
    jjj                       d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ dd	lmZ dd
lmZmZ ddlmZ ddlmZmZ ej.                  r0d dlmZmZmZ d dlmZmZ d dlmZ d dl	m Z   ejB                  d      Z" G d de      Z# G d de      Z$ G d dee         Z% G d de%      Z& G d dee         Z'd Z(e)dk(  r e(        yy)    )annotationsN)CompositeCanvas)Command)connect_signal)calc_coords)is_mouse_press   )Columns)AlignWrapMode)Text)WidgetError
WidgetWrap)CallableHashableMutableSequence)LiteralSelf)
TextCanvas)
TextLayout_Tc                       e Zd ZdZdZdej                  ej                  df	 	 	 	 	 	 	 	 	 	 	 d	 fdZ		 d
	 	 	 	 	 d fdZ
ddZ	 	 	 	 	 	 ddZ xZS )SelectableIconFTr   Nc                :    t         |   ||||       || _        y)a3  
        :param text: markup for this widget; see :class:`Text` for
                     description of text markup
        :param cursor_position: position the cursor will appear in the
                                text when this widget is in focus
        :param align: typically ``'left'``, ``'center'`` or ``'right'``
        :type align: text alignment mode
        :param wrap: typically ``'space'``, ``'any'``, ``'clip'`` or ``'ellipsis'``
        :type wrap: text wrapping mode
        :param layout: defaults to a shared :class:`StandardTextLayout` instance
        :type layout: text layout instance

        This is a text widget that is selectable.  A cursor
        displayed at a fixed location in the text when in focus.
        This widget has no special handling of keyboard or mouse input.
        alignwraplayoutN)super__init___cursor_position)selftextcursor_positionr   r   r   	__class__s         Z/home/ubuntu/.cache/pipx/cdb5059130eadca/lib/python3.12/site-packages/urwid/widget/wimp.pyr    zSelectableIcon.__init__3   s#    0 	UfE /    c                n    t         |   ||      }|r!t        |      }| j                  |      |_        |S )aE  
        Render the text content of this widget with a cursor when
        in focus.

        >>> si = SelectableIcon("[!]")
        >>> si
        <SelectableIcon selectable fixed/flow widget '[!]'>
        >>> si.render((4,), focus=True).cursor
        (0, 0)
        >>> si = SelectableIcon("((*))", 2)
        >>> si.render((8,), focus=True).cursor
        (2, 0)
        >>> si.render((2,), focus=True).cursor
        (0, 1)
        >>> si.render(()).cursor
        >>> si.render(()).text
        [b'((*))']
        >>> si.render((), focus=True).cursor
        (2, 0)
        )r   renderr   get_cursor_coordscursor)r"   sizefocuscr%   s       r&   r)   zSelectableIcon.renderN   s9    2 +0'.u*E"A--d3AHr'   c                    | j                   t        | j                        kD  ry|r|\  }n| j                         \  }}| j	                  |      }t        | j                  || j                         \  }}||k  ry||fS )z
        Return the position of the cursor if visible.  This method
        is required for widgets that display a cursor.
        N)r!   lenr#   packget_line_translationr   )r"   r,   maxcol_transxys          r&   r*   z SelectableIcon.get_cursor_coordsn   sw    
   3tyy>1 IV		IFA))&1499eT-B-BC1Q;!tr'   c                    |S )zn
        No keys are handled by this widget.  This method is
        required for selectable widgets.
         r"   r,   keys      r&   keypresszSelectableIcon.keypress   s	     
r'   )r#   =str | tuple[Hashable, str] | list[str | tuple[Hashable, str]]r$   intr   *Literal['left', 'center', 'right'] | Alignr   6Literal['space', 'any', 'clip', 'ellipsis'] | WrapModer   TextLayout | NonereturnNone)F)r,   tuple[int] | tuple[()]r-   boolrB   zTextCanvas | CompositeCanvas)r,   rD   rB   ztuple[int, int] | None)r,   rD   r;   strrB   rF   )__name__
__module____qualname__ignore_focus_selectabler   LEFTr   SPACEr    r)   r*   r<   __classcell__r%   s   @r&   r   r   /   s    LK
  !<AJJGO~~$(0K0 0 :	0
 E0 "0 
0< $  
&	@&	$	 	 
		r'   r   c                      e Zd Zy)CheckBoxErrorN)rG   rH   rI   r9   r'   r&   rQ   rQ      s    r'   rQ   c                  V    e Zd ZU  edd       edd       edd      dZded<   dZd	d
gZded<   ej                  	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 dd       Z
ej                  	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 dd       Z
ej                  	 	 	 	 	 d 	 	 	 	 	 	 	 	 	 	 	 	 	 d!d       Z
ej                  	 	 	 	 	 d"	 	 	 	 	 	 	 	 	 	 	 	 	 d#d       Z
	 	 	 	 	 d$	 	 	 	 	 	 	 	 	 	 	 d% fdZ
d&d' fdZd( fdZd) fdZd*dZd Z ee      Z	 d+	 	 	 	 	 d,dZd-dZ eee      Zd.dZd/dZd0dZ xZS )1CheckBoxz[X]r	   z[ ]z[#]TFmixed>typing.ClassVar[dict[bool | Literal['mixed'], SelectableIcon]]states   change
postchangetyping.ClassVar[list[str]]signalsc                     y Nr9   r"   labelstate	has_mixedon_state_change	user_datachecked_symbols          r&   r    zCheckBox.__init__        r'   c                     y r^   r9   r_   s          r&   r    zCheckBox.__init__   rf   r'   c                     y r^   r9   r_   s          r&   r    zCheckBox.__init__   rf   r'   c                     y r^   r9   r_   s          r&   r    zCheckBox.__init__   rf   r'   c                   || j                   vr1t        |dt        | j                   j                                      t	        |      | _        || _        || _        |rt        d| dd      | j                   d<   |rt        | d||       t        | -  t        | j                  | j                   |   f| j
                  gd             y	)
a~  
        :param label: markup for check box label
        :param state: False, True or "mixed"
        :param has_mixed: True if "mixed" is a state to cycle through
        :param on_state_change: shorthand for connect_signal()
                                function call for a single callback
        :param user_data: user_data for on_state_change

        ..note:: `pack` method expect, that `Columns` backend widget is not modified from outside

        Signals supported: ``'change'``, ``"postchange"``

        Register signal handler with::

          urwid.connect_signal(check_box, "change", callback, user_data)

        where callback is callback(check_box, new_state [,user_data])
        Unregister signal handlers with::

          urwid.disconnect_signal(check_box, "change", callback, user_data)

        >>> CheckBox("Confirm")
        <CheckBox selectable fixed/flow widget 'Confirm' state=False>
        >>> CheckBox("Yogourt", "mixed", True)
        <CheckBox selectable fixed/flow widget 'Yogourt' state='mixed'>
        >>> cb = CheckBox("Extra onions", True)
        >>> cb
        <CheckBox selectable fixed/flow widget 'Extra onions' state=True>
        >>> cb.render((20,), focus=True).text
        [b'[X] Extra onions    ']
        >>> CheckBox("Test", None)
        Traceback (most recent call last):
        ...
        ValueError: None not in (True, False, 'mixed')
        z not in []r	   TrY   r   focus_columnN)rW   
ValueErrortuplekeysr   _labelrb   _stater   r   r   r    r
   reserve_columns)r"   r`   ra   rb   rc   rd   re   r%   s          r&   r    zCheckBox.__init__   s    d #yt{{7G7G7I1J0KLMM5k" .>2B!/Da HDKK 4?IF 	&&E(:;T[[I	
r'   c                ,    t         |   |xs d|      S )a  Pack for widget.

        :param size: size data. Special case: None - get minimal widget size to fit
        :param focus: widget is focused

        >>> cb = CheckBox("test")
        >>> cb.pack((10,))
        (10, 1)
        >>> cb.pack()
        (8, 1)
        >>> ml_cb = CheckBox("Multi\nline\ncheckbox")
        >>> ml_cb.pack()
        (12, 3)
        >>> ml_cb.pack((), True)
        (12, 3)
        r9   r   r1   r"   r,   r-   r%   s      r&   r1   zCheckBox.pack  s    " w|DJB..r'   c                N    g t         |          t        | j                        S r^   r   _repr_wordsreprr`   r"   r%   s    r&   rz   zCheckBox._repr_words%  s$    9$&9TZZ(899r'   c                @    i t         |          d| j                  iS )Nra   )r   _repr_attrsra   r|   s    r&   r~   zCheckBox._repr_attrs(  s!    =%'%'=$**==r'   c                :    | j                   j                  |       y)a  
        Change the check box label.

        label -- markup for label.  See Text widget for description
        of text markup.

        >>> cb = CheckBox("foo")
        >>> cb
        <CheckBox selectable fixed/flow widget 'foo' state=False>
        >>> cb.set_label(("bright_attr", "bar"))
        >>> cb
        <CheckBox selectable fixed/flow widget 'bar' state=False>
        Nrr   set_textr"   r`   s     r&   	set_labelzCheckBox.set_label+  s     	U#r'   c                .    | j                   j                  S )a;  
        Return label text.

        >>> cb = CheckBox("Seriously")
        >>> print(cb.get_label())
        Seriously
        >>> print(cb.label)
        Seriously
        >>> cb.set_label([("bright_attr", "flashy"), " normal"])
        >>> print(cb.label)  #  only text is returned
        flashy normal
        rr   r#   r"   s    r&   	get_labelzCheckBox.get_label=  s     {{r'   c                F   | j                   |k(  ry|| j                  vrt        | d|      | j                   }|r| j                  d|       || _         t	        | j
                  | j                  |   f| j                  gd      | _        |r| j                  d|       yy)a#  
        Set the CheckBox state.

        state -- True, False or "mixed"
        do_callback -- False to suppress signal from this change

        >>> from urwid import disconnect_signal
        >>> changes = []
        >>> def callback_a(user_data, cb, state):
        ...     changes.append("A %r %r" % (state, user_data))
        >>> def callback_b(cb, state):
        ...     changes.append("B %r" % state)
        >>> cb = CheckBox("test", False, False)
        >>> key1 = connect_signal(cb, "change", callback_a, user_args=("user_a",))
        >>> key2 = connect_signal(cb, "change", callback_b)
        >>> cb.set_state(True)  # both callbacks will be triggered
        >>> cb.state
        True
        >>> disconnect_signal(cb, "change", callback_a, user_args=("user_a",))
        >>> cb.state = False
        >>> cb.state
        False
        >>> cb.set_state(True)
        >>> cb.state
        True
        >>> cb.set_state(False, False)  # don't send signal
        >>> changes
        ["A True 'user_a'", 'B True', 'B False', 'B True']
        Nz Invalid state: rY   r   rm   rZ   )rs   rW   rQ   _emitr
   rt   rr   _w)r"   ra   do_callback	old_states       r&   	set_statezCheckBox.set_stateN  s    D ;;%#4(*:5) DEE KK	JJx'D00$++e2DEt{{SbcdJJ|Y/ r'   c                    | j                   S )z!Return the state of the checkbox.)rs   r   s    r&   	get_statezCheckBox.get_state  s    {{r'   c                h    | j                   |   t        j                  k7  r|S | j                          y)a  
        Toggle state on 'activate' command.

        >>> assert CheckBox._command_map[" "] == "activate"
        >>> assert CheckBox._command_map["enter"] == "activate"
        >>> size = (10,)
        >>> cb = CheckBox("press me")
        >>> cb.state
        False
        >>> cb.keypress(size, " ")
        >>> cb.state
        True
        >>> cb.keypress(size, " ")
        >>> cb.state
        False
        N)_command_mapr   ACTIVATEtoggle_stater:   s      r&   r<   zCheckBox.keypress  s1    " S!W%5%55Jr'   c                   | j                   du r| j                  d       y| j                   du r0| j                  r| j                  d       y| j                  d       y| j                   dk(  r| j                  d       yy)aM  
        Cycle to the next valid state.

        >>> cb = CheckBox("3-state", has_mixed=True)
        >>> cb.state
        False
        >>> cb.toggle_state()
        >>> cb.state
        True
        >>> cb.toggle_state()
        >>> cb.state
        'mixed'
        >>> cb.toggle_state()
        >>> cb.state
        False
        FTrU   N)ra   r   rb   r   s    r&   r   zCheckBox.toggle_state  sd    " ::NN4 ZZ4~~w'u%ZZ7"NN5! #r'   c                F    |dk7  st        |      sy| j                          y)a  
        Toggle state on button 1 press.

        >>> size = (20,)
        >>> cb = CheckBox("clickme")
        >>> cb.state
        False
        >>> cb.mouse_event(size, "mouse press", 1, 2, 0, True)
        True
        >>> cb.state
        True
        r	   FT)r   r   r"   r,   eventbuttonr6   r7   r-   s          r&   mouse_eventzCheckBox.mouse_event  s$     Q;nU3r'   )FFN..)r`   r=   ra   rE   rb   typing.Literal[False]rc   -Callable[[Self, bool, _T], typing.Any] | Nonerd   r   re   
str | NonerB   rC   )FTN..)r`   r=   ra   typing.Literal['mixed'] | boolrb   typing.Literal[True]rc   zGCallable[[Self, bool | typing.Literal['mixed'], _T], typing.Any] | Nonerd   r   re   r   rB   rC   )FFNN.)r`   r=   ra   rE   rb   r   rc   )Callable[[Self, bool], typing.Any] | Nonerd   rC   re   r   rB   rC   )FTNN.)r`   r=   ra   r   rb   r   rc   zCCallable[[Self, bool | typing.Literal['mixed']], typing.Any] | Nonerd   rC   re   r   rB   rC   )FFNNN)r`   r=   ra   bool | Literal['mixed']rb   ztyping.Literal[False, True]rc   zCallable[[Self, bool, _T], typing.Any] | Callable[[Self, bool | typing.Literal['mixed'], _T], typing.Any] | Callable[[Self, bool], typing.Any] | Callable[[Self, bool | typing.Literal['mixed']], typing.Any] | Nonerd   	_T | Nonere   r   NF)r,   tuple[()] | tuple[int] | Noner-   rE   rB   ztuple[str, str]rB   z	list[str])rB   zdict[str, typing.Any])r`   r=   Tra   r   r   rE   rB   rC   )rB   r   r,   
tuple[int]r;   rF   rB   r   rB   rC   r,   r   r   rF   r   r>   r6   r>   r7   r>   r-   rE   rB   rE   )rG   rH   rI   r   rW   __annotations__rt   r\   typingoverloadr    r1   rz   r~   r   r   propertyr`   r   r   ra   r<   r   r   rN   rO   s   @r&   rS   rS      s   UA&eQ'q)NFJ 
 O
 ,4\*BG'B__ +0IM%(L  )	
 G  # 
  __ 16*.cg%(L . (	
 a  # 
  __ +0EI%(L  )	
 C  # 
  __ 16*._c%(L . (	
 ]  # 
  */16 #%)F
LF
 'F
 /	F
F
 F
 #F
P/&:>$$  YE
 !10&10 10 
	10f Y	*E."6r'   rS   c                  "    e Zd ZU  edd       edd       edd      dZded<   dZej                  	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd	       Z	ej                  	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd
       Z		 	 	 d	 	 	 	 	 	 	 	 	 	 	 d fdZ	dd fdZ
ddZ xZS )RadioButtonz(X)r	   z( )z(#)rT   rV   rW   rX   c                     y r^   r9   r"   groupr`   ra   rc   rd   s         r&   r    zRadioButton.__init__       r'   c                     y r^   r9   r   s         r&   r    zRadioButton.__init__  r   r'   c                l    |dk(  r| }|| _         t        | 	  ||d||       |j                  |        y)a  
        :param group: list for radio buttons in same group
        :param label: markup for radio button label
        :param state: False, True, "mixed" or "first True"
        :param on_state_change: shorthand for connect_signal()
                                function call for a single 'change' callback
        :param user_data: user_data for on_state_change

        ..note:: `pack` method expect, that `Columns` backend widget is not modified from outside

        This function will append the new radio button to group.
        "first True" will set to True if group is empty.

        Signals supported: ``'change'``, ``"postchange"``

        Register signal handler with::

          urwid.connect_signal(radio_button, "change", callback, user_data)

        where callback is callback(radio_button, new_state [,user_data])
        Unregister signal handlers with::

          urwid.disconnect_signal(radio_button, "change", callback, user_data)

        >>> bgroup = []  # button group
        >>> b1 = RadioButton(bgroup, "Agree")
        >>> b2 = RadioButton(bgroup, "Disagree")
        >>> len(bgroup)
        2
        >>> b1
        <RadioButton selectable fixed/flow widget 'Agree' state=True>
        >>> b2
        <RadioButton selectable fixed/flow widget 'Disagree' state=False>
        >>> b2.render((15,), focus=True).text  # ... = b in Python 3
        [...'( ) Disagree   ']
        
first TrueFN)r   r   r    append)r"   r   r`   ra   rc   rd   r%   s         r&   r    zRadioButton.__init__  s=    X L IE
uoyITr'   c                    | j                   |k(  ryt        | 	  ||       |dury| j                  D ]  }|| u r|j                  sd|_         y)a  
        Set the RadioButton state.

        state -- True, False or "mixed"

        do_callback -- False to suppress signal from this change

        If state is True all other radio buttons in the same button
        group will be set to False.

        >>> bgroup = []  # button group
        >>> b1 = RadioButton(bgroup, "Agree")
        >>> b2 = RadioButton(bgroup, "Disagree")
        >>> b3 = RadioButton(bgroup, "Unsure")
        >>> b1.state, b2.state, b3.state
        (True, False, False)
        >>> b2.set_state(True)
        >>> b1.state, b2.state, b3.state
        (False, True, False)
        >>> def relabel_button(radio_button, new_state):
        ...     radio_button.set_label("Think Harder!")
        >>> key = connect_signal(b3, "change", relabel_button)
        >>> b3
        <RadioButton selectable fixed/flow widget 'Unsure' state=False>
        >>> b3.set_state(True)  # this will trigger the callback
        >>> b3
        <RadioButton selectable fixed/flow widget 'Think Harder!' state=True>
        NTF)rs   r   r   r   ra   )r"   ra   r   cbr%   s       r&   r   zRadioButton.set_state  s]    : ;;%%-  ** 	!BTzxx 		!r'   c                &    | j                  d       y)a  
        Set state to True.

        >>> bgroup = []  # button group
        >>> b1 = RadioButton(bgroup, "Agree")
        >>> b2 = RadioButton(bgroup, "Disagree")
        >>> b1.state, b2.state
        (True, False)
        >>> b2.toggle_state()
        >>> b1.state, b2.state
        (False, True)
        >>> b2.toggle_state()
        >>> b1.state, b2.state
        (False, True)
        TN)r   r   s    r&   r   zRadioButton.toggle_stateI  s      	tr'   ).N.)r   MutableSequence[RadioButton]r`   r=   ra   bool | Literal['first True']rc   r   rd   r   rB   rC   ).NN)r   r   r`   r=   ra   r   rc   r   rd   rC   rB   rC   )r   NN)r   r   r`   r=   ra   r   rc   zRCallable[[Self, bool, _T], typing.Any] | Callable[[Self, bool], typing.Any] | Nonerd   r   rB   rC   r   r   r   )rG   rH   rI   r   rW   r   rt   r   r   r    r   r   rN   rO   s   @r&   r   r     sL   UA&eQ'q)NFJ 
 O__
 /2IM+ M ,	
 G  
  __
 /2EI+ M ,	
 C  
  /;nr#1+1 M1 ,	1
 l1 1 
1f,!\r'   r   c                      e Zd ZU  ed      Z ed      ZdgZded<   ej                  	 	 ddddd	 	 	 	 	 	 	 	 	 	 	 	 	 dd	       Z
ej                  	 	 ddddd	 	 	 	 	 	 	 	 	 	 	 	 	 dd
       Z
	 	 dej                  ej                  dd	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZ
dd fdZd fdZddZddZ ee      ZddZddZ xZS )Button<>clickr[   r\   N.r   c                    y r^   r9   r"   r`   on_pressrd   r   r   r   s          r&   r    zButton.__init__b       r'   c                    y r^   r9   r   s          r&   r    zButton.__init__n  r   r'   c                   t        |d|||      | _        t        d| j                  f| j                  d| j                  fgd      }t
        |   |       |rt        | d||       yy)uh  
        :param label: markup for button label
        :param on_press: shorthand for connect_signal()
                         function call for a single callback
        :param user_data: user_data for on_press
        :param align: typically ``'left'``, ``'center'`` or ``'right'``
        :type align: label alignment mode
        :param wrap: typically ``'space'``, ``'any'``, ``'clip'`` or ``'ellipsis'``
        :type wrap: label wrapping mode
        :param layout: defaults to a shared :class:`StandardTextLayout` instance
        :type layout: text layout instance

        ..note:: `pack` method expect, that `Columns` backend widget is not modified from outside

        Signals supported: ``'click'``

        Register signal handler with::

          urwid.connect_signal(button, "click", callback, user_data)

        where callback is callback(button [,user_data])
        Unregister signal handlers with::

          urwid.disconnect_signal(button, "click", callback, user_data)

        >>> from urwid.util import set_temporary_encoding
        >>> Button("Ok")
        <Button selectable fixed/flow widget 'Ok'>
        >>> b = Button("Cancel")
        >>> b.render((15,), focus=True).text  # ... = b in Python 3
        [b'< Cancel      >']
        >>> aligned_button = Button("Test", align=Align.CENTER)
        >>> aligned_button.render((10,), focus=True).text
        [b'<  Test  >']
        >>> wrapped_button = Button("Long label", wrap=WrapMode.ELLIPSIS)
        >>> with set_temporary_encoding("utf-8"):
        ...     wrapped_button.render((7,), focus=False).text[0].decode("utf-8")
        '< Lo… >'
        r   r   r	   )dividecharsr   N)r   rr   r
   button_leftbutton_rightr   r    r   )	r"   r`   r   rd   r   r   r   colsr%   s	           r&   r    zButton.__init__z  sr    b %UAUfU!!"DKK!T5F5F1GH
 	 4(I> r'   c                ,    t         |   |xs d|      S )aA  Pack for widget.

        :param size: size data. Special case: None - get minimal widget size to fit
        :param focus: widget is focused

        >>> btn = Button("Some button")
        >>> btn.pack((10,))
        (10, 2)
        >>> btn.pack()
        (15, 1)
        >>> btn.pack((), True)
        (15, 1)
        r9   rv   rw   s      r&   r1   zButton.pack  s     w|DJB..r'   c                N    g t         |          t        | j                        S r^   ry   r|   s    r&   rz   zButton._repr_words  s$    9$&9TZZ(899r'   c                :    | j                   j                  |       y)z
        Change the button label.

        label -- markup for button label

        >>> b = Button("Ok")
        >>> b.set_label("Yup yup")
        >>> b
        <Button selectable fixed/flow widget 'Yup yup'>
        Nr   r   s     r&   r   zButton.set_label  s     	U#r'   c                .    | j                   j                  S )z
        Return label text.

        >>> b = Button("Ok")
        >>> print(b.get_label())
        Ok
        >>> print(b.label)
        Ok
        r   r   s    r&   r   zButton.get_label  s     {{r'   c                j    | j                   |   t        j                  k7  r|S | j                  d       y)aD  
        Send 'click' signal on 'activate' command.

        >>> assert Button._command_map[" "] == "activate"
        >>> assert Button._command_map["enter"] == "activate"
        >>> size = (15,)
        >>> b = Button("Cancel")
        >>> clicked_buttons = []
        >>> def handle_click(button):
        ...     clicked_buttons.append(button.label)
        >>> key = connect_signal(b, "click", handle_click)
        >>> b.keypress(size, "enter")
        >>> b.keypress(size, " ")
        >>> clicked_buttons  # ... = u in Python 2
        [...'Cancel', ...'Cancel']
        r   N)r   r   r   r   r:   s      r&   r<   zButton.keypress  s1    " S!W%5%55J

7r'   c                H    |dk7  st        |      sy| j                  d       y)a  
        Send 'click' signal on button 1 press.

        >>> size = (15,)
        >>> b = Button("Ok")
        >>> clicked_buttons = []
        >>> def handle_click(button):
        ...     clicked_buttons.append(button.label)
        >>> key = connect_signal(b, "click", handle_click)
        >>> b.mouse_event(size, "mouse press", 1, 4, 0, True)
        True
        >>> b.mouse_event(size, "mouse press", 2, 4, 0, True)  # ignored
        False
        >>> clicked_buttons  # ... = u in Python 2
        [...'Ok']
        r	   Fr   T)r   r   r   s          r&   r   zButton.mouse_event  s$    " Q;nU3

7r'   )N.)r`   r=   r   z'Callable[[Self, _T], typing.Any] | Nonerd   r   r   r?   r   r@   r   rA   rB   rC   )NN)r`   r=   r   z#Callable[[Self], typing.Any] | Nonerd   rC   r   r?   r   r@   r   rA   rB   rC   )r`   r=   r   zFCallable[[Self, _T], typing.Any] | Callable[[Self], typing.Any] | Nonerd   r   r   r?   r   r@   r   rA   rB   rC   r   )r,   r   r-   rE   rB   ztuple[int, int]r   )r`   r=   rB   rC   )rB   zstr | bytesr   r   )rG   rH   rI   r   r   r   r\   r   r   r   r    r   rL   r   rM   r1   rz   r   r   r   r`   r<   r   rN   rO   s   @r&   r   r   \  s   s)K9L+2)G'3__ =A		 =@GJ$'	L	 :	 		 :	 E	 "	 
	 	 __ 9=		 =@GJ$'	L	 6	 		 :	 E	 "	 
	 	 \`#	;? =BJJGO~~$(;?L;? Y;? 	;? :;? E;? ";? 
;?z/ :$
  YE.r'   r   c                 ,    dd l } | j                          y )Nr   )doctesttestmod)r   s    r&   _testr     s    OOr'   __main__)*
__future__r   r   urwid.canvasr   urwid.command_mapr   urwid.signalsr   urwid.text_layoutr   
urwid.utilr   columnsr
   	constantsr   r   r#   r   widgetr   r   TYPE_CHECKINGcollections.abcr   r   r   typing_extensionsr   r   r   r   TypeVarr   r   rQ   rS   r   r   r   rG   r9   r'   r&   <module>r      s   * #  ( % ( ) %  &  +	CC/',		B[T [|	K 	xz'" xv	M( M`vZ  vr z	G r'   