a
    ¦ˆca  ã                   @   sT   d Z ddlZddlmZmZmZmZ ddlmZ G dd„ deƒZ	G dd„ deƒZ
dS )	z Heading text. é    N)Ú	HasTraitsÚIntÚ	InterfaceÚStr)ÚImagec                   @   s&   e Zd ZdZedƒZedƒZeƒ Z	dS )ÚIHeadingTextz/ A widget which shows heading text in a panel. é   ÚDefaultN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úlevelr   Útextr   Úimage© r   r   úX/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/i_heading_text.pyr      s   r   c                       sn   e Zd ZdZedƒZedƒZd‡ fdd„	Z‡ fdd„Z	‡ fd	d
„Z
‡ fdd„Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚMHeadingTextzw The mixin class that contains common code for toolkit specific
    implementations of the IHeadingText interface.
    r   r	   Nc                    sR   d|v rt  dt¡ | dd¡}tƒ jf d|i|¤Ž |rN|  ¡  t  dt¡ dS )z Creates the heading text. r   zpbackground images are no-longer supported for Wx and the 'image' trait will be removed in a future Pyface updateÚcreateTÚparentzšautomatic widget creation is deprecated and will be removed in a future Pyface version, use create=False and explicitly call create() for future behaviourN)ÚwarningsÚwarnÚPendingDeprecationWarningÚpopÚsuperÚ__init__r   )Úselfr   Ztraitsr   ©Ú	__class__r   r   r   1   s    ýüzMHeadingText.__init__c                    s   t ƒ  ¡  |  | j¡ dS )z> Perform any toolkit-specific initialization for the control. N)r   Ú_initialize_controlÚ_set_control_textr   ©r   r   r   r   r   N   s    
z MHeadingText._initialize_controlc                    s    t ƒ  ¡  | j| jddd� d S )Nr   Úui)Údispatch)r   Ú_add_event_listenersÚobserveÚ_text_updatedr!   r   r   r   r$   S   s    
z!MHeadingText._add_event_listenersc                    s"   | j | jdddd� tƒ  ¡  d S )Nr   r"   T)r#   Úremove)r%   r&   r   Ú_remove_event_listenersr!   r   r   r   r(   W   s    z$MHeadingText._remove_event_listenersc                 C   s
   t ƒ ‚dS )z¬ Set the text on the control.

        Parameters
        ----------
        text : str
            The text to display.  This can contain basic HTML-like markeup.
        N©ÚNotImplementedError)r   r   r   r   r   r    _   s    zMHeadingText._set_control_textc                 C   s
   t ƒ ‚dS )zŽ Get the text on the control.

        Returns
        ----------
        text : str
            The text to displayed in the widget.
        Nr)   r!   r   r   r   Ú_get_control_texti   s    zMHeadingText._get_control_textc                 C   s   | j d ur|  | j¡ d S )N)Úcontrolr    r   )r   Úeventr   r   r   r&   u   s    
zMHeadingText._text_updated)N)r
   r   r   r   r   r   r   r   r   r   r$   r(   r    r+   r&   Ú__classcell__r   r   r   r   r   $   s   
r   )r   r   Z
traits.apir   r   r   r   Zpyface.ui_traitsr   r   r   r   r   r   r   Ú<module>   s
   