+
     Bi	                         R t ^ RI5  ! R R4      t ! R R]4      t ! R R]4      tR t]R	8X  d"   ^ R
IHt ]! R^RR7       ^ RI	H
t
 ]
! ]4       R# R# )zTools for displaying tool-tips.

This includes:
 * an abstract base-class for different kinds of tooltips
 * a simple text-only Tooltip class
)*c                   N   a  ] tR t^
t o RtR tR tR tR tR t	R t
R tR	tV tR
# )TooltipBasez abstract base class for tooltipsc                     Wn         RV n        R# )zCreate a tooltip.

anchor_widget: the widget next to which the tooltip will be shown

Note that a widget will only be shown when showtip() is called.
Nanchor_widget	tipwindow)selfr   s   &&&/usr/lib/python3.14/idlelib/tooltip.py__init__TooltipBase.__init__   s     +    c                &    V P                  4        R # Nhidetipr	   s   &r
   __del__TooltipBase.__del__   s    r   c                   V P                   '       d   R# \        V P                  4      ;V n         pVP                  ^4        VP                  P                  RRVP                  RR4       V P                  4        V P                  4        V P                   P                  4        V P                   P                  4        R#   \         d     Lci ; i)zdisplay the tooltipNz!::tk::unsupported::MacWindowStylestylehelpnoActivates)r   Toplevelr   wm_overrideredirecttkcall_wTclErrorposition_windowshowcontentsupdate_idletasksliftr	   tws   & r
   showtipTooltipBase.showtip   s    >>>&t'9'9::
q!	 EEJJ:GRUU}.
 	'')  		s   )C CCc                    V P                  4       w  rV P                  P                  4       V,           pV P                  P                  4       V,           pV P                  P                  RW43,          4       R# )z&(re)-set the tooltip's screen position+%d+%dN)get_positionr   winfo_rootxwinfo_rootyr   wm_geometry)r	   xyroot_xroot_ys   &    r
   r   TooltipBase.position_window/   s^      "##//1A5##//1A5""8v.>#>?r   c                H    ^V P                   P                  4       ^,           3# )z(choose a screen position for the tooltip)r   winfo_heightr   s   &r
   r)   TooltipBase.get_position6   s#     4%%224q888r   c                    \         h)z$content display hook for sub-classes)NotImplementedErrorr   s   &r
   r    TooltipBase.showcontentsA   s
     "!r   c                    V P                   pRV n         V'       d    VP                  4        R# R#   \         d     R# i ; izhide the tooltipN)r   destroyr   r#   s   & r
   r   TooltipBase.hidetipF   s>     ^^

   s   1 A A r   N)__name__
__module____qualname____firstlineno____doc__r   r   r%   r   r)   r    r   __static_attributes____classdictcell__)__classdict__s   @r
   r   r   
   s1     **@	9"
	 	r   r   c                   r   a a ] tR t^Rt oRtR
V 3R lltV 3R ltRR ltRR ltR t	R t
V 3R ltR	tVtV ;t# )OnHoverTooltipBasez?abstract base class for tooltips, with delayed on-hover displayc                B  < \         SV `  V4       W n        RV n        V P                  P                  RV P                  4      V n        V P                  P                  RV P                  4      V n	        V P                  P                  RV P                  4      V n
        R# )aA  Create a tooltip with a mouse hover delay.

anchor_widget: the widget next to which the tooltip will be shown
hover_delay: time to delay before showing the tooltip, in milliseconds

Note that a widget will only be shown when showtip() is called,
e.g. after hovering over the anchor widget with the mouse for enough
time.
N<Enter><Leave><Button>)superr   hover_delay	_after_idr   bind_show_event_id1_hide_event_id2_id3)r	   r   rK   	__class__s   &&&r
   r   OnHoverTooltipBase.__init__U   s     	'&&&++It7G7GH	&&++It7G7GH	&&++J8H8HI	r   c                ,  <  V P                   P                  R V P                  4       V P                   P                  RV P                  4       V P                   P                  RV P                  4       \        SV `  4        R#   \
         d     Li ; i)rG   rH   rI   N)r   unbindrO   rQ   rR   r   rJ   r   r	   rS   s   &r
   r   OnHoverTooltipBase.__del__g   sv    	%%i;%%i;%%j$))< 	  		s   A2B BBc                n    V P                   '       d   V P                  4        R# V P                  4        R# )z$event handler to display the tooltipN)rK   scheduler%   r	   events   &&r
   rN   OnHoverTooltipBase._show_eventp   s     MMOLLNr   c                &    V P                  4        R# )z!event handler to hide the tooltipNr   r[   s   &&r
   rP   OnHoverTooltipBase._hide_eventw   s    r   c                    V P                  4        V P                  P                  V P                  V P                  4      V n        R# )z*schedule the future display of the tooltipN)
unscheduler   afterrK   r%   rL   r   s   &r
   rZ   OnHoverTooltipBase.schedule{   s4    ++11$2B2B26,,@r   c                v    V P                   pRV n         V'       d   V P                  P                  V4       R# R# )z(cancel the future display of the tooltipN)rL   r   after_cancel)r	   after_ids   & r
   ra   OnHoverTooltipBase.unschedule   s.    >>++H5 r   c                h   <  V P                  4        \        SV `  4        R#   \         d     Li ; ir9   )ra   r   rJ   r   rW   s   &r
   r   OnHoverTooltipBase.hidetip   s2    	OO 	  		s   # 11)rL   rO   rQ   rR   rK   )  r   )r<   r=   r>   r?   r@   r   r   rN   rP   rZ   ra   r   rA   rB   __classcell__rS   rC   s   @@r
   rE   rE   R   s2     IJ$@6 r   rE   c                   @   a a ] tR t^t oRtRV 3R lltR tRtVtV ;t	# )HovertipzAA tooltip that pops up when a mouse hovers over an anchor widget.c                L   < \         SV `  WR7       W n        W@n        WPn        R# )aF  Create a text tooltip with a mouse hover delay.

anchor_widget: the widget next to which the tooltip will be shown
hover_delay: time to delay before showing the tooltip, in milliseconds

Note that a widget will only be shown when showtip() is called,
e.g. after hovering over the anchor widget with the mouse for enough
time.
rK   N)rJ   r   text
foreground
background)r	   r   rq   rK   rr   rs   rS   s   &&&&&&r
   r   Hovertip.__init__   s$     	@	$$r   c           
         \        V P                  V P                  \        \        ^V P
                  V P                  R7      pVP                  4        R# )   )rq   justifyreliefborderwidthrr   rs   N)Labelr   rq   LEFTSOLIDrr   rs   pack)r	   labels   & r
   r    Hovertip.showcontents   s8    dnn499d#!"&//dooO 	

r   )rs   rr   rq   )rj   z#000000z#ffffe0)
r<   r=   r>   r?   r@   r   r    rA   rB   rk   rl   s   @@r
   rn   rn      s     G%  r   rn   c                    \        V 4      pVP                  R 4       \        \        V P	                  4       P                  R4      R,          4      w  r#VP	                  RW#^,           3,          4       \        VRR7      pVP                  4        \        VRR7      pVP                  4        \        VRRR	7       \        VR
R7      pVP                  4        \        VRRR	7       R# )zTest tooltip+:rv   NNr(   zPlace your mouse over buttons)rq   z"Button 1 -- 1/2 second hover delayz!This is tooltip text for button1.i  rp   zButton 2 -- no hover delayz!This is tooltip
text for button2.N)
r   titlemapintgeometrysplitrz   r}   Buttonrn   )parenttopr-   r.   r~   button1button2s   &      r
   _tooltipr      s    
6
CIInsFOO%++C045DALLQCL()#;<E	JJLSCDGLLNW9sKS;<GLLNW:Mr   __main__)mainzidlelib.idle_test.test_tooltipF)	verbosityexit)runN)r@   tkinterr   rE   rn   r   r<   unittestr   idlelib.idle_test.htestr    r   r
   <module>r      se    E EP< <~! 2N z	)QUC+M r   