Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.146.105.252
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : calltip_w.cpython-311.pyc
�

Tf�����dZddlmZmZmZmZddlmZdZdZ	dZ
dZdZd	Z
Gd
�de��Zd�Zed
kr'ddlmZeddd���ddlmZee��dSdS)zvA call-tip window class for Tkinter/IDLE.

After tooltip.py, which uses ideas gleaned from PySol.
Used by calltip.py.
�)�Label�LEFT�SOLID�TclError)�TooltipBasez<<calltipwindow-hide>>)z<Key-Escape>z
<FocusOut>z<<calltipwindow-checkhide>>)z<KeyRelease>z<ButtonRelease>�d�calltipwindowregion_rightc�f��eZdZdZ�fd�Zd�Z�fd�Z�fd�Zd�Zd
d�Z	d	�Z
�fd
�Zd�Zd�Z
�xZS)�
CalltipWindowz+A call-tip widget for tkinter text widgets.c���t���|��dx|_|_dx|_x|_|_dx|_|_d|_	dS)z}Create a call-tip; shown by showtip().

        text_widget: a Text widget with code for which call-tips are desired
        N)
�super�__init__�label�text�	parenline�parencol�lastline�hideid�checkhideid�checkhide_after_id)�self�text_widget�	__class__s  ��:/usr/local/python-3.11/lib/python3.11/idlelib/calltip_w.pyrzCalltipWindow.__init__s]���	������%�%�%�!%�%��
�T�Y�9=�=���=�����)-�-���d�&�"&�����c��t|j�d���d��d��}||jkr|j|jf}n|df}|j�d|z��}|s1t|j�d����}d|d<d|d<|ddz|d|dzfS)z$Choose the position of the call-tip.�insert�.rz%d.%d���)�int�
anchor_widget�index�splitrr�bbox�list)r�curline�anchor_index�boxs    r�get_positionzCalltipWindow.get_position#s����d�(�.�.�x�8�8�>�>�s�C�C�A�F�G�G���d�n�$�$� �N�D�M�:�L�L�#�Q�<�L�� �%�%�g��&<�=�=���	��t�)�.�.�x�8�8�9�9�C��C��F��C��F��1�v��z�3�q�6�C��F�?�*�*rc�$��t|j�d���d��d��}||jkrdS||_|j�d��t
�����dS)z Reposition the window if needed.rrrN)r"r#r$r%r�seer
�position_window)rr(rs  �rr.zCalltipWindow.position_window2s�����d�(�.�.�x�8�8�>�>�s�C�C�A�F�G�G���d�m�#�#��F���
�����x�(�(�(�
�����!�!�!�!�!rc�x��||_|js|jsdS|j�t|��tt|j�|���d����\|_	|_
t�����|�
��dS)a_Show the call-tip, bind events which will close it and reposition it.

        text: the text to display in the call-tip
        parenleft: index of the opening parenthesis in the text widget
        parenright: index of the closing parenthesis in the text widget,
                    or the end of the line if there is no closing parenthesis
        Nr)r�	tipwindowr#�mark_set�
MARK_RIGHT�mapr"r$r%rrr
�showtip�_bind_events)rr�	parenleft�
parenrightrs    �rr4zCalltipWindow.showtip;s������	��>�	���	��F���#�#�J�
�;�;�;�(+���#�)�)�)�4�4�:�:�3�?�?�)A�)A�%����
�	���������������rc��t|j|jtddtd|jd���|_|j���dS)zCreate the call-tip widget.z#ffffd0�blackr �font)r�justify�
background�
foreground�relief�borderwidthr:N)rr0rrrr#r�pack)rs r�showcontentszCalltipWindow.showcontentsPsQ���4�>��	�4�&/�G�"'�Q� $� 2�6� :�<�<�<��
�	
�
�������rNc��|jsdStt|j�d���d����\}}||jks7||jkr||jks!|j�ddt��r|�
��dS|���|j�|j�
|j��|j�t|j��|_dS)z4Handle CHECK_HIDE_EVENT: call hidetip or reschedule.Nrr�>�break)r0r3r"r#r$r%rr�comparer2�hidetipr.r�after_cancel�after�CHECKHIDE_TIME�checkhide_event)r�eventr(�curcols    rrJzCalltipWindow.checkhide_eventXs����~�	��4��c�4�#5�#;�#;�H�#E�#E�#K�#K�C�#P�#P�Q�Q�����T�^�#�#��t�~�%�%�&�D�M�*A�*A���%�%�h��Z�@�@�+B��L�L�N�N�N��7�	
�������"�.���+�+�D�,C�D�D�D���$�$�^�T�5I�J�J�	
���trc�@�|jsdS|���dS)z%Handle HIDE_EVENT by calling hidetip.NrD)r0rF)rrKs  r�
hide_eventzCalltipWindow.hide_eventss#���~�	��4��������wrc���|jsdS	|j���n#t$rYnwxYwd|_dx|_x|_|_	|j�t��n#t$rYnwxYw	|�
��n#ttf$rYnwxYwt���
��dS)zHide the call-tip.N)r0r�destroyrrrrr#�
mark_unsetr2�_unbind_events�
ValueErrorr
rF)rrs �rrFzCalltipWindow.hidetip{s����~�	��F�	��J��� � � � ���	�	�	��D�	������
�9=�=���=�����	���)�)�*�5�5�5�5���	�	�	��D�	����	����!�!�!�!���*�%�	�	�	��D�	����	���������s0�&�
3�3�A3�3
B�?B�B�B-�,B-c��|j�t|j��|_t
D]"}|j�t|���#|j�t|j��|j�t|j
��|_tD]"}|j�t|���#dS)zBind event handlers.N)
r#�bind�CHECKHIDE_EVENTrJr�CHECKHIDE_SEQUENCES�	event_addrHrI�
HIDE_EVENTrNr�HIDE_SEQUENCES�r�seqs  rr5zCalltipWindow._bind_events�s����-�2�2�?�37�3G�I�I���&�	?�	?�C���(�(��#�>�>�>�>��� � ���1E�F�F�F��(�-�-�j�.2�o�?�?���!�	:�	:�C���(�(��S�9�9�9�9�	:�	:rc�^�tD]"}|j�t|���#|j�t|j��d|_tD]"}|j�t|���#|j�t|j��d|_dS)zUnbind event handlers.N)	rWr#�event_deleterV�unbindrrZrYrr[s  rrRzCalltipWindow._unbind_events�s���&�	B�	B�C���+�+�O�S�A�A�A�A���!�!�/�4�3C�D�D�D����!�	=�	=�C���+�+�J��<�<�<�<���!�!�*�d�k�:�:�:�����r�N)�__name__�
__module__�__qualname__�__doc__rr+r.r4rArJrNrFr5rR�
__classcell__)rs@rrrs��������5�5�'�'�'�'�'�
+�
+�
+�"�"�"�"�"������*�������6��������2
:�
:�
:�	�	�	�	�	�	�	rrc����ddlm}m}m}m}||��}|�d��t
t|����	d��dd���\}}|�d|dz|dzfz��||��}|�
||d�	��|�d
d��|���t|����fd�}	�fd
�}
|�dd��|�dd��|�d|	��|�d|
��|���dS)Nr)�Toplevel�Textr�BOTHzTest call-tips�+r z
250x100+%d+%d��)�side�fill�expandrzstring.splitc�6����ddd��dS)Nz(s='Hello world')r�end)r4�rK�calltips �r�calltip_showz%_calltip_window.<locals>.calltip_show�s ������+�X�u�=�=�=�=�=rc�0������dSr`)rFrrs �r�calltip_hidez%_calltip_window.<locals>.calltip_hide�s����������rz<<calltip-show>>�(z<<calltip-hide>>�))�tkinterrgrhrri�titler3r"�geometryr%r@r�updaterrXrU�	focus_set)�parentrgrhrri�top�x�yrrtrvrss           @r�_calltip_windowr��s����2�2�2�2�2�2�2�2�2�2�2�2�
�(�6�
�
�C��I�I������s�F�O�O�%�%�+�+�C�0�0����4�5�5�D�A�q��L�L��A��G�Q��W�#5�5�6�6�6��4��9�9�D��I�I�4�d�1�I�-�-�-��K�K��.�)�)�)��J�J�L�L�L��D�!�!�G�>�>�>�>�>�������N�N�%�s�+�+�+��N�N�%�s�+�+�+��I�I� �,�/�/�/��I�I� �,�/�/�/��N�N�����r�__main__)�mainz idlelib.idle_test.test_calltip_wrF)�	verbosity�exit)�runN)rdryrrrr�idlelib.tooltiprrYrZrVrWrIr2rr�ra�unittestr��idlelib.idle_test.htestr��rr�<module>r�s����
1�0�0�0�0�0�0�0�0�0�0�0�'�'�'�'�'�'�
%�
�/��/��9����
(�
�V�V�V�V�V�K�V�V�V�r���2�z����������D�	+�q�u�E�E�E�E�+�+�+�+�+�+��C��������r
© 2025 GrazzMean