python (3.12.0)
̑eG d Z ddl G d d Z G d de Z G d de Zd Zed
k( r ddlmZ edd
d ddl m
Z
e
e yy)zTools for displaying tool-tips.
This includes:
* an abstract base-class for different kinds of tooltips
* a simple text-only Tooltip class
)*c : e Zd ZdZd Zd Zd Zd Zd Zd Z d Z
y )
TooltipBasez abstract base class for tooltipsc || _ d| _ y)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 C/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/idlelib/tooltip.py__init__zTooltipBase.__init__
s + c $ | j y Nhidetipr s r
__del__zTooltipBase.__del__ s r c | j ryt | j x| _ }|j d |j j dd|j dd | j | j | j j | j j y# t $ r Y `w xY w)zdisplay the tooltipN z!::tk::unsupported::MacWindowStylestylehelpnoActivates)r Toplevelr wm_overrideredirecttkcall_wTclErrorposition_windowshowcontentsupdate_idletasksliftr tws r
showtipzTooltipBase.showtip s >>&t'9'9::
q!
EEJJ:GRUU}
.
'')
s )B: : CCc | j \ }}| j j |z }| j j |z }| j j d||fz y)z&(re)-set the tooltip's screen position+%d+%dN)get_positionr winfo_rootxwinfo_rootyr wm_geometry)r xyroot_xroot_ys r
r zTooltipBase.position_window/ sb "1##//1A5##//1A5""8vv.>#>?r c @ d| j j dz fS )z(choose a screen position for the tooltip r )r winfo_heightr s r
r'