python (3.11.7)

(root)/
lib/
python3.11/
idlelib/
__pycache__/
calltip_w.cpython-311.pyc

edZddlmZmZmZmZddlmZdZdZ	dZ
dZdZd	Z
Gd
deZdZed
kr'ddlmZedddddlmZeedSdS)zvA call-tip window class for Tkinter/IDLE.

After tooltip.py, which uses ideas gleaned from PySol.
Used by calltip.py.
)LabelLEFTSOLIDTclError)TooltipBasez<<calltipwindow-hide>>)z<Key-Escape>z
<FocusOut>z<<calltipwindow-checkhide>>)z<KeyRelease>z<ButtonRelease>dcalltipwindowregion_rightcfeZdZdZfdZdZfdZfdZdZd
dZ	d	Z
fd
ZdZdZ
xZS)
CalltipWindowz+A call-tip widget for tkinter text widgets.ct|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__labeltext	parenlineparencollastlinehideidcheckhideidcheckhide_after_id)selftext_widget	__class__s  E/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/idlelib/calltip_w.pyrzCalltipWindow.__init__s]	%%%!%%
TY9===)--d&"&ct|jddd}||jkr|j|jf}n|df}|jd|z}|s1t|jd}d|d<d|d<|ddz|d|dzfS)z$Choose the position of the call-tip.insert.rz%d.%d)int
anchor_widgetindexsplitrrbboxlist)rcurlineanchor_indexboxs    rget_positionzCalltipWindow.get_position#sd(..x88>>sCCAFGGdn$$ NDM:LL#Q<L %%g&<==	t)..x8899CCFCF1vz3q6CF?**rc$t|jddd}||jkrdS||_|jdt
dS)z Reposition the window if needed.rrrN)r"r#r$r%rseer
position_window)rr(rs  rr.zCalltipWindow.position_window2sd(..x88>>sCCAFGGdm##F
x(((
!!!!!rcx||_|js|jsdS|jt|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_RIGHTmapr"r$r%rrr
showtip_bind_events)rr	parenleft
parenrightrs    rr4zCalltipWindow.showtip;s	>		F##J
;;;(+#)))44::3??)A)A%
	rct|j|jtddtd|jd|_|jdS)zCreate the call-tip widget.z#ffffd0blackr font)rjustify
background
foregroundreliefborderwidthr:N)rr0rrrr#rpack)rs rshowcontentszCalltipWindow.showcontentsPsQ4>	4&/G"'Q $ 26 :<<<
	
rNc|jsdStt|jdd\}}||jks7||jkr||jks!|jddtr|
dS||j|j
|j|jt|j|_dS)z4Handle CHECK_HIDE_EVENT: call hidetip or reschedule.Nrr>break)r0r3r"r#r$r%rrcomparer2hidetipr.rafter_cancelafterCHECKHIDE_TIMEcheckhide_event)reventr(curcols    rrJzCalltipWindow.checkhide_eventXs~	4c4#5#;#;H#E#E#K#KC#P#PQQT^##t~%%&DM*A*A%%hZ@@+BLLNNN7	
".++D,CDDD$$^T5IJJ	
trc@|jsdS|dS)z%Handle HIDE_EVENT by calling hidetip.NrD)r0rF)rrKs  r
hide_eventzCalltipWindow.hide_eventss#~	4wrc|jsdS	|jn#t$rYnwxYwd|_dx|_x|_|_	|jtn#t$rYnwxYw	|
n#ttf$rYnwxYwt
dS)zHide the call-tip.N)r0rdestroyrrrrr#
mark_unsetr2_unbind_events
ValueErrorr
rF)rrs rrFzCalltipWindow.hidetip{s~	F	J    			D	
9===	))*5555			D		!!!!*%			D		s0&
33A33
B?BBB-,B-c|jt|j|_t
D]"}|jt|#|jt|j|jt|j
|_tD]"}|jt|#dS)zBind event handlers.N)
r#bindCHECKHIDE_EVENTrJrCHECKHIDE_SEQUENCES	event_addrHrI
HIDE_EVENTrNrHIDE_SEQUENCESrseqs  rr5zCalltipWindow._bind_eventss-22?373GII&	?	?C((#>>>>  1EFFF(--j.2o??!	:	:C((S9999	:	:rc^tD]"}|jt|#|jt|jd|_tD]"}|jt|#|jt|jd|_dS)zUnbind event handlers.N)	rWr#event_deleterVunbindrrZrYrr[s  rrRzCalltipWindow._unbind_eventss&	B	BC++OSAAAA!!/43CDDD!	=	=C++J<<<<!!*dk:::rN)__name__
__module____qualname____doc__rr+r.r4rArJrNrFr5rR
__classcell__)rs@rrrs55'''''
+
+
+"""""*62
:
:
:							rrcddlm}m}m}m}||}|dt
t|	ddd\}}|d|dz|dzfz||}|
||d	|d
d|t|fd}	fd
}
|dd|dd|d|	|d|
|dS)Nr)ToplevelTextrBOTHzTest call-tips+r z
250x100+%d+%d)sidefillexpandrzstring.splitc6ddddS)Nz(s='Hello world')rend)r4rKcalltips rcalltip_showz%_calltip_window.<locals>.calltip_shows +Xu=====rc0dSr`)rFrrs rcalltip_hidez%_calltip_window.<locals>.calltip_hidesrz<<calltip-show>>(z<<calltip-hide>>))tkinterrgrhrrititler3r"geometryr%r@rupdaterrXrU	focus_set)parentrgrhrritopxyrrtrvrss           @r_calltip_windowrs222222222222
(6

CIIsFOO%%++C00455DAqLLAGQW#55666499DII4d1I---KK.)))JJLLLD!!G>>>>>NN%s+++NN%s+++II ,///II ,///NNr__main__)mainz idlelib.idle_test.test_calltip_wrF)	verbosityexit)runN)rdryrrrridlelib.tooltiprrYrZrVrWrIr2rrraunittestridlelib.idle_test.htestrrr<module>rs
100000000000''''''
%
//9
(
VVVVVKVVVr2zD	+quEEEE++++++Cr