%PDF- %PDF-
Direktori : /usr/local/lib/python3.8/idlelib/__pycache__/ |
Current File : //usr/local/lib/python3.8/idlelib/__pycache__/tooltip.cpython-38.pyc |
U qa @ s| d Z ddlT G dd dZG dd deZG dd deZd d ZedkrxddlmZ ed ddd ddl m Z e e dS )zTools for displaying tool-tips. This includes: * an abstract base-class for different kinds of tooltips * a simple text-only Tooltip class )*c @ sH e Zd ZdZdd Zdd Zdd Zdd Zd d Zdd Z dd Z dS )TooltipBasez abstract base class for tooltipsc C s || _ d| _dS )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 r +/usr/local/lib/python3.8/idlelib/tooltip.py__init__ s zTooltipBase.__init__c C s | d S )Nhidetipr r r r __del__ s zTooltipBase.__del__c C s| | j r dS t| j | _ }|d z|jdd|jdd W n tk rR Y nX | | | j | j dS )zdisplay the tooltipN z!::tk::unsupported::MacWindowStylestylehelpZnoActivates)r Toplevelr Zwm_overrideredirectZtkcallZ_wTclErrorposition_windowshowcontentsZupdate_idletasksZliftr Ztwr r r showtip s zTooltipBase.showtipc C s@ | \}}| j | }| j | }| jd||f dS )z&(re)-set the tooltip's screen position+%d+%dN)get_positionr Zwinfo_rootxZwinfo_rootyr Zwm_geometry)r xyZroot_xZroot_yr r r r / s zTooltipBase.position_windowc C s d| j d fS )z(choose a screen position for the tooltip r )r Zwinfo_heightr r r r r 6 s zTooltipBase.get_positionc C s t dS )z$content display hook for sub-classesN)NotImplementedErrorr r r r r A s zTooltipBase.showcontentsc C s6 | j }d| _ |r2z| W n tk r0 Y nX dS zhide the tooltipN)r Zdestroyr r r r r r F s zTooltipBase.hidetipN)__name__ __module____qualname____doc__r r r r r r r r r r r r s r c s^ e Zd ZdZd fdd Z fddZddd Zdd dZdd Zdd Z fddZ ZS )OnHoverTooltipBasez?abstract base class for tooltips, with delayed on-hover display c sV t t| | || _d| _| jd| j| _| jd| j | _ | jd| j | _dS )aq 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# r hover_delay _after_idr bind_show_event_id1_hide_event_id2_id3)r r r) __class__r r r U s zOnHoverTooltipBase.__init__c s\ z4| j d| j | j d| j | j d| j W n tk rH Y nX tt| d S )Nr% r&