Your IP : 3.144.16.40
��Yf�G � @ s� d Z d d l TGd d � d e � Z Gd d � d e � Z Gd d � d e � Z Gd d
� d
e � Z d d � Z e d
k r� d d l
m Z e e � d S)a An implementation of tabbed pages using only standard Tkinter.
Originally developed for use in IDLE. Based on tabpage.py.
Classes exported:
TabbedPageSet -- A Tkinter implementation of a tabbed-page widget.
TabSet -- A widget containing tabs (buttons) in one or more rows.
� )�*c @ s e Z d Z d S)�InvalidNameErrorN)�__name__�
__module__�__qualname__� r r �8/opt/alt/python35/lib64/python3.5/idlelib/tabbedpages.pyr s r c @ s e Z d Z d S)�AlreadyExistsErrorN)r r r r r r r r
s r c @ s� e Z d Z d Z d d d d d d � Z d d � Z d
d � Z d d
� Z d d � Z d d � Z d d � Z
Gd d � d e � Z d S)�TabSetzjA widget containing tabs (buttons) in one or more rows.
Only one tab may be selected at a time.
N� � Fc K s� t j | | | � | | _ | | _ | | _ | | _ | | _ i | _ i | _ | rj t | � | _
n g | _
d | _ g | _ t | d d d d d t
d | j d � �| _ | j j d t d t d
d � | j � d S)a Constructor arguments:
select_command -- A callable which will be called when a tab is
selected. It is called with the name of the selected tab as an
argument.
tabs -- A list of strings, the names of the tabs. Should be specified in
the desired tab order. The first tab will be the default and first
active tab. If tabs is None or empty, the TabSet will be initialized
empty.
n_rows -- Number of rows of tabs to be shown. If n_rows <= 0 or is
None, then the number of rows will be decided by TabSet. See
_arrange_tabs() for details.
max_tabs_per_row -- Used for deciding how many rows of tabs are needed,
when the number of rows is not constant. See _arrange_tabs() for
details.
N�height� �borderwidthr �relief�
background�side�fill�expandF)�Frame�__init__�select_command�n_rows�max_tabs_per_row�expand_tabs�page_set�_tabs�_tab2row�list�
_tab_names�
_selected_tab� _tab_rows�FLAT�cgetZ
padding_frame�pack�TOP�X�
_arrange_tabs)�selfr r Ztabsr r r �kwr r r r s$ zTabSet.__init__c C sS | s t d | � � | | j k r5 t d | � � | j j | � | j � d S)z.Add a new tab with the name given in tab_name.zInvalid Tab name: '%s'zTab named '%s' already existsN)r r r �appendr'