3
ÌœŸW)  ã               @   s$   d Z ddlmZ G dd„ deƒZdS )z*Used by tvtk_base_handler to create a UI.
é    )ÚObjectColumnc               @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚValueColumnzG Column to display the trait value for each trait of a tvtk object.
   c             C   s   |j S )z‹ Returns the actual object being edited.
        Overridden here to return the tvtk object (which is the parent trait of object).

        )Úparent)ÚselfÚobject© r   úT/home/yuhw/wc/wire-cell-python/venv/lib/python3.6/site-packages/tvtk/value_column.pyÚ
get_object
   s    zValueColumn.get_objectc             C   sL   |j }| j|ƒ}|jdƒ}|dk r*||fS t||d|… ƒ||d d… fS )z¾ Returns the target object and name for the column.
        Overridden here to return the trait name (which is the object's name trait) rather than the
        column's name trait.

        Ú.r   Né   )Únamer	   ÚrfindÚxgetattr)r   r   r   Úcolr   r   r   Útarget_name   s    

zValueColumn.target_namec          	   C   s(   y| j |ƒ\}}t||ƒS    dS dS )zÌ Gets the unformatted value of the column for a specified object.
        Overridden here to return the trait name (which is the object's name trait) rather than the
        column's name trait.

        N)r   r   )r   r   Útargetr   r   r   r   Úget_raw_value!   s
    
zValueColumn.get_raw_valueN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   r   r   r   r   r   r      s   r   N)r   Útraitsui.table_columnr   r   r   r   r   r   Ú<module>   s   