Your IP : 3.139.86.58


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/calltip_w.cpython-36.opt-2.pyc

3

��2a��@s�ddlmZmZmZmZddlmZdZdZdZ	dZ
d	Zd
ZGdd�de�Z
d
d�Zedkr�ddlmZedddd�ddlmZee�dS)�)�Label�LEFT�SOLID�TclError)�TooltipBasez<<calltipwindow-hide>>�<Key-Escape>�
<FocusOut>z<<calltipwindow-checkhide>>�<KeyRelease>�<ButtonRelease>�dZcalltipwindowregion_rightcsreZdZ�fdd�Zdd�Z�fdd�Z�fdd�Zd	d
�Zddd
�Zdd�Z	�fdd�Z
dd�Zdd�Z�Z
S)�
CalltipWindowcsDtt|�j|�d|_|_d|_|_|_d|_|_	d|_
dS)N)�superr�__init__�label�text�	parenline�parencol�lastline�hideid�checkhideid�checkhide_after_id)�selfZtext_widget)�	__class__��./opt/alt/python36/lib64/python3.6/calltip_w.pyrs
zCalltipWindow.__init__cCs�t|jjd�jd�d�}||jkr2|j|jf}n|df}|jjd|�}|snt|jjd��}d|d<d|d<|dd|d|dfS)N�insert�.rz%d.%d���)�int�
anchor_widget�index�splitrrZbbox�list)r�curlineZanchor_indexZboxrrr�get_position#s
zCalltipWindow.get_positioncsLt|jjd�jd�d�}||jkr(dS||_|jjd�tt|�j�dS)Nrrr)	r r!r"r#rZseer
r�position_window)rr%)rrrr'2s
zCalltipWindow.position_windowcs`||_|js|jrdS|jjt|�tt|jj|�jd��\|_	|_
tt|�j
�|j�dS)Nr)r�	tipwindowr!Zmark_set�
MARK_RIGHT�mapr r"r#rrr
r�showtip�_bind_events)rrZ	parenleftZ
parenright)rrrr+;s	zCalltipWindow.showtipc	Cs0t|j|jtdtd|jdd�|_|jj�dS)Nz#ffffe0r�font)rZjustifyZ
backgroundZreliefZborderwidthr-)rr(rrrr!r�pack)rrrr�showcontentsPszCalltipWindow.showcontentsNcCs�|js
dStt|jjd�jd��\}}||jksT||jkrD||jksT|jjddt	�r`|j
�dS|j�|jdk	r�|jj
|j�|jjt|j�|_dS)Nrr�>�break)r(r*r r!r"r#rrZcomparer)�hidetipr'rZafter_cancel�after�CHECKHIDE_TIME�checkhide_event)r�eventr%Zcurcolrrrr5Ws

zCalltipWindow.checkhide_eventcCs|js
dS|j�dS)Nr1)r(r2)rr6rrr�
hide_eventrszCalltipWindow.hide_eventcs�|js
dSy|jj�Wntk
r,YnXd|_d|_|_|_y|jjt	�Wntk
rjYnXy|j
�Wnttfk
r�YnXtt
|�j�dS)N)r(rZdestroyrrrrr!Z
mark_unsetr)�_unbind_events�
ValueErrorr
rr2)r)rrrr2zs"zCalltipWindow.hidetipcCsp|jjt|j�|_xtD]}|jjt|�qW|jjt|j�|jjt	|j
�|_xtD]}|jjt	|�qVWdS)N)
r!�bind�CHECKHIDE_EVENTr5r�CHECKHIDE_SEQUENCES�	event_addr3r4�
HIDE_EVENTr7r�HIDE_SEQUENCES)r�seqrrrr,�s



zCalltipWindow._bind_eventscCshxtD]}|jjt|�qW|jjt|j�d|_xtD]}|jjt|�q8W|jjt|j�d|_dS)N)	r<r!Zevent_deleter;Zunbindrr?r>r)rr@rrrr8�s

zCalltipWindow._unbind_events)N)�__name__�
__module__�__qualname__rr&r'r+r/r5r7r2r,r8�
__classcell__rr)rrrs
	
rcs�ddlm}m}m}m}||�}|jd�tt|j�j	d�dd��\}}|jd|d|df�||�}|j
||dd	�|jd
d�|j�t
|���fdd
�}	�fdd�}
|jdd�|jdd�|jd|	�|jd|
�|j�dS)Nr)�Toplevel�Textr�BOTHzTest call-tips�+rz
250x100+%d+%d��)Zside�fill�expandrzstring.splitcs�jddd�dS)Nz(s='Hello world')r�end)r+)r6)�calltiprr�calltip_show�sz%_calltip_window.<locals>.calltip_showcs�j�dS)N)r2)r6)rNrr�calltip_hide�sz%_calltip_window.<locals>.calltip_hidez<<calltip-show>>�(z<<calltip-hide>>�))�tkinterrErFrrG�titler*r Zgeometryr#r.r�updaterr=r:Z	focus_set)�parentrErFrrG�top�x�yrrOrPr)rNr�_calltip_window�s"
 rZ�__main__)�mainz idlelib.idle_test.test_calltip_wrF)�	verbosity�exit)�runN)rr)r	r
)rSrrrrZidlelib.tooltiprr>r?r;r<r4r)rrZrAZunittestr\Zidlelib.idle_test.htestr_rrrr�<module>s

?>