Your IP : 18.188.218.134


Current Path : /opt/alt/python35/lib64/python3.5/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/idlelib/__pycache__/CallTipWindow.cpython-35.opt-2.pyc



���]��@s�ddlmZmZmZmZmZdZdZdZdZ	dZ
d	ZGd
d�d�Zdd
�Z
edkr�ddlmZee
�dS)�)�Toplevel�Label�LEFT�SOLID�TclErrorz<<calltipwindow-hide>>�<Key-Escape>�
<FocusOut>z<<calltipwindow-checkhide>>�<KeyRelease>�<ButtonRelease>�dZcalltipwindowregion_rightc@sgeZdZdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dS)�CallTipcCsO||_d|_|_d|_|_d|_d|_|_d|_dS)N)	�widget�	tipwindow�label�	parenline�parencol�lastline�hideid�checkhideid�checkhide_after_id)�selfr
�r�2/opt/alt/python35/lib64/python3.5/CallTipWindow.py�__init__s		zCallTip.__init__cCs%t|jjd�jd�d�}||jkr8dS||_|jjd�||jkr�|jjd|j|jf�}n|jjd|�}|s�t	|jjd��}d|d<d|d<|d|jj
�d}|d|d|jj�}|jj
d	||f�dS)
N�insert�.rz%d.%dz%d.0���z+%d+%d)�intr
�index�splitrZseerZbboxr�list�winfo_rootx�winfo_rootyrZwm_geometry)r�curlineZbox�x�yrrr�position_windows %	

zCallTip.position_windowcCs�||_|js|jr dS|jjt|�tt|jj|�jd��\|_	|_
t|j�|_}|j�|j
d�y#|jjdd|jdd�Wntk
r�YnXt|d|jdtd	d
dtddd
|jd
�|_|jj�|j�|jjt|j�|_x!tD]}|jjt|�q>W|jjt|j�|jjt |j!�|_"x!t#D]}|jjt |�q�WdS)Nrrz!::tk::unsupported::MacWindowStyle�style�helpZnoActivates�textZjustifyZ
backgroundz#ffffe0ZreliefZborderwidthZfont)$r+rr
Zmark_set�
MARK_RIGHT�maprr r!rrrr(Zwm_overrideredirectZtk�callZ_wrrrrr�packZlift�bind�CHECKHIDE_VIRTUAL_EVENT_NAME�checkhide_eventr�CHECKHIDE_SEQUENCES�	event_add�after�CHECKHIDE_TIME�HIDE_VIRTUAL_EVENT_NAME�
hide_eventr�HIDE_SEQUENCES)rr+Z	parenleftZ
parenrightZtw�seqrrr�showtip/s8	-






zCallTip.showtipNcCs�|js
dStt|jjd�jd��\}}||jks|||jkrd||jks||jjddt	�r�|j
�nG|j�|jdk	r�|jj
|j�|jjt|j�|_dS)Nrr�>)rr-rr
r r!rrZcomparer,�hidetipr(rZafter_cancelr5r6r2)r�eventr%Zcurcolrrrr2Ws	*

zCallTip.checkhide_eventcCs|js
dS|j�dS)N)rr=)rr>rrrr8is	zCallTip.hide_eventcCs�|js
dSx!tD]}|jjt|�qW|jjt|j�d|_x!tD]}|jjt|�qWW|jjt|j	�d|_	|j
j�d|_
|jj�d|_|jjt
�d|_|_|_dS)N)rr3r
Zevent_deleter1Zunbindrr9r7rrZdestroyZ
mark_unsetr,rrr)rr:rrrr=os 	
	
	
	
	zCallTip.hidetipcCs
t|j�S)N)�boolr)rrrr�	is_active�szCallTip.is_active)
�__name__�
__module__�__qualname__rr(r;r2r8r=r@rrrrrs(rc	s&ddlm}m}m}m}||�}|jd�|jd|j�d|j�df�||�}|j	d|d|d	d
�|j
dd�|j�t|���fd
d�}�fdd�}|j
dd�|j
dd�|jd|�|jd|�|j�dS)Nr)r�Textr�BOTHz
Test calltipsz
200x100+%d+%d���Zside�fill�expandrrzstring.splitcs�jddd�dS)Nz(s=Hello world)r�end)r;)r>)�calltiprr�calltip_show�sz%_calltip_window.<locals>.calltip_showcs�j�dS)N)r=)r>)rKrr�calltip_hide�sz%_calltip_window.<locals>.calltip_hidez<<calltip-show>>�(z<<calltip-hide>>�))�tkinterrrDrrE�titleZgeometryr#r$r/r�updaterr4r0Z	focus_set)	�parentrrDrrE�topr+rLrMr)rKr�_calltip_window�s""

rU�__main__)�runN)rr)r	r
)rPrrrrrr7r9r1r3r6r,rrUrAZidlelib.idle_test.htestrWrrrr�<module>s(x

?>