a
    ¦ˆc=  ã                   @   s2   d 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. é   )ÚOK)Útoolkit_objectz'single_choice_dialog:SingleChoiceDialogÚChooseTc                 C   s2   t | ||||d�}| ¡ }|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	   ÚdialogÚresultr   © r   ú^/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/single_choice_dialog.pyÚ
choose_one   s    ûr   N)r   T)Ú__doc__Zconstantr   Ztoolkitr   r
   r   r   r   r   r   Ú<module>   s   