a
    §ˆci  ã                   @   sT   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 G dd	„ d	eƒZd
S )z( Traits UI 'display only' image editor.
é    )ÚImageResource)Úconvert_bitmap)ÚImageEditoré   )ÚEditor)ÚImageControlc                   @   s    e Zd ZdZdd„ Zdd„ ZdS )Ú_ImageEditorz&Traits UI 'display only' image editor.c                 C   sH   | j j}|du r| j}|dur(t|ƒ}nd}t||dd�| _|  ¡  dS )z\Finishes initializing the editor by creating the underlying toolkit
        widget.
        Nr   )Úpadding)ÚfactoryÚimageÚvaluer   r   ÚcontrolZset_tooltip)ÚselfÚparentr   Úbitmap© r   ú[/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/traitsui/wx/image_editor.pyÚinit$   s    
z_ImageEditor.initc                 C   s8   | j jdu r4| j}|dur$t|ƒ}nd}| j |¡ dS )z[Updates the editor when the object trait changes externally to the
        editor.
        N)r
   r   r   r   r   ZBitmap)r   r   r   r   r   r   Úupdate_editor4   s    
z_ImageEditor.update_editorN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   !   s   r   N)r   Zpyface.image_resourcer   Ztraitsui.ui_traitsr   Ztraitsui.editors.image_editorr   Zeditorr   Zimage_controlr   r   r   r   r   r   Ú<module>   s   