3
<Ad]3  ã               @   s>   d Z ddlmZ ddlmZ ddlmZ edƒZdd	d
„ZdS )zC A dialog that allows the user to chose a single item from a list. é    )Úabsolute_importé   )ÚOK)Útoolkit_objectz'single_choice_dialog:SingleChoiceDialogÚChooseTc             C   s2   t | ||||d�}|jƒ }|tkr*|j}nd}|S )a   Convenience method to show an information message dialog.

    Parameters
    ----------
    parent : toolkit control or None
        The toolkit control that should be the parent of the dialog.
    message : str
        The text of the message to display.
    choices : list
        List of objects to choose from.
    title : str
        The text of the dialog title.
    cancel : bool
        Whether or not the dialog can be cancelled.

    Returns
    -------
    choice : any
        The selected object, or None if cancelled.
    )ÚparentÚmessageÚchoicesÚtitleÚcancelN)ÚSingleChoiceDialogÚopenr   Úchoice)r   r   r	   r
   r   ZdialogÚresultr   © r   úu/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/pyface-6.1.2-py3.6.egg/pyface/single_choice_dialog.pyÚ
choose_one   s    r   N)r   T)	Ú__doc__Ú
__future__r   Úconstantr   Ztoolkitr   r   r   r   r   r   r   Ú<module>   s
   