
    geY
                         d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	m
Z
mZmZ ddlmZ  G d d	ee          Ze G d
 de                      Ze G d de                      ZdS )zpSelectionContainer class.

Represents a multipage container that can be used to group other widgets into
pages.
   )Box)register)
CoreWidget    )UnicodeDictCInt
TraitErrorvalidate)unicode_typec                        e Zd ZdZ ed                              d          Z edd                              d          Z e	d          d	             Z
d
 Zd Z fdZ xZS )_SelectionContainerz2Base class used to display multiple child widgets.zTitles of the pages)helpTsynczThe index of the selected page. This is either an integer selecting a particular sub-widget, or None to have no widgets selected.)r   
allow_noneselected_indexc                     |j         'd|j         cxk    rt          | j                  k     r
n n|j         S t          d          )Nr   z&Invalid selection: index out of bounds)valuelenchildrenr
   )selfproposals     Llib/python3.11/site-packages/ipywidgets/widgets/widget_selectioncontainer.py_validated_indexz$_SelectionContainer._validated_index   sN    >!Q(.%M%M%M%M3t};M;M%M%M%M%M%M>!EFFF    c                 |    t          t          |                    }|| j        |<   |                     d           dS )zSets the title of a container page.

        Parameters
        ----------
        index : int
            Index of the container page
        title : unicode
            New title
        _titlesN)r   intr   
send_state)r   indextitles      r   	set_titlez_SelectionContainer.set_title!   s;     SZZ((#U	"""""r   c                 j    t          t          |                    }|| j        v r| j        |         S dS )zGets the title of a container pages.

        Parameters
        ----------
        index : int
            Index of the container page
        N)r   r   r   )r   r!   s     r   	get_titlez_SelectionContainer.get_title0   s6     SZZ((DL  <&&4r   c              #      K   t          t          |                                           D ]}|V  | j        rdV  d S d S )Nr   )superr   
_repr_keysr   )r   key	__class__s     r   r(   z_SelectionContainer._repr_keys?   sY      ,d33>>@@ 	 	CIIII< 	OOOOO	 	r   )__name__
__module____qualname____doc__r   tagr   r	   r   r   r   r#   r%   r(   __classcell__)r*   s   @r   r   r      s        <<d-...222==GT U   
ctcnn 
 XG G  G# # #          r   r   c                       e Zd ZdZ ed                              d          Z ed                              d          ZdS )	Accordionz4Displays children each on a separate accordion page.AccordionViewTr   AccordionModelNr+   r,   r-   r.   r   r/   
_view_name_model_name r   r   r2   r2   G   sU        >>))--4-88J'*++//T/::KKKr   r2   c                       e Zd ZdZ ed                              d          Z ed                              d          ZdS )Tabz3Displays children each on a separate accordion tab.TabViewTr   TabModelNr5   r8   r   r   r:   r:   N   sT        ==##''T'22J'*%%))t)44KKKr   r:   N)r.   
widget_boxr   widgetr   widget_corer   	traitletsr   r   r	   r
   r   ipython_genutils.py3compatr   r   r2   r:   r8   r   r   <module>rB      s(                # # # # # # ? ? ? ? ? ? ? ? ? ? ? ? ? ? 3 3 3 3 3 33 3 3 3 3#z 3 3 3l 
; ; ; ; ;# ; ; 
; 
5 5 5 5 5
 5 5 
5 5 5r   