3
8ßL]ì
  ã               @   s`   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
 ddlmZ G d	d
„ d
e
ƒZdS )z( Traits UI 'display only' image editor.
é    )Úabsolute_import)Ú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   s6   | j j}|dkr| j}t|t|ƒdd�| _| jƒ  dS )za Finishes initializing the editor by creating the underlying toolkit
            widget.
        Nr   )Úpadding)ÚfactoryÚimageÚvaluer   r   ÚcontrolZset_tooltip)ÚselfÚparentr   © r   ú>/tmp/pip-install-5sebvq2j/traitsui/traitsui/wx/image_editor.pyÚinit:   s    

z_ImageEditor.initc             C   s0   | j jdkr,| j}t|tƒr,| jjt|ƒƒ dS )z` Updates the editor when the object trait changes externally to the
            editor.
        N)r   r   r   Ú
isinstancer   r   ZBitmapr   )r   r   r   r   r   Úupdate_editorK   s    
z_ImageEditor.update_editorN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r	   1   s   r	   N)r   Ú
__future__r   Zpyface.image_resourcer   Ztraitsui.ui_traitsr   Ztraitsui.editors.image_editorr   Úeditorr   Zimage_controlr   r	   r   r   r   r   Ú<module>   s   