AlkantarClanX12

Your IP : 18.191.178.16


Current Path : /usr/lib64/python3.8/tkinter/__pycache__/
Upload File :
Current File : //usr/lib64/python3.8/tkinter/__pycache__/ttk.cpython-38.pyc

U

e5d���@s�dZdZdZddddddd	d
ddd
ddddddddddddddgZddlZddlmZmZmZmZej	dkrpd nd!Z
d"d#�ZdXd$d%�ZdYd&d'�Z
d(d)�ZdZd*d+�Zd[d,d-�Zd\d/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d�Zd]d@d�ZGdAd�de�ZGdBdC�dCej�ZGdDd�de�ZGdEd�de�ZGdFd�deej �Z GdGd�de �Z!GdHd�de�Z"GdId�de�Z#GdJd	�d	e�Z$e$Z%GdKd�de�Z&GdLd�de�Z'GdMd
�d
eej(�Z)e)Z(GdNd�de�Z*GdOd�de�Z+GdPd�deej,�Z,GdQd�deej-�Z-GdRd�de�Z.GdSd�de�Z/GdTd�de �Z0GdUd�deej1ej2�Z3GdVd�de"�Z4GdWd�de&�Z5dS)^a�Ttk wrapper.

This module provides classes to allow using Tk themed widget set.

Ttk is based on a revised and enhanced version of
TIP #48 (http://tip.tcl.tk/48) specified style engine.

Its basic idea is to separate, to the extent possible, the code
implementing a widget's behavior from the code implementing its
appearance. Widget class bindings are primarily responsible for
maintaining the widget state and invoking callbacks, all aspects
of the widgets appearance lies at Themes.
z0.3.1z!Guilherme Polo <ggpolo@gmail.com>�Button�Checkbutton�Combobox�Entry�Frame�Label�
Labelframe�
LabelFrame�
Menubutton�Notebook�Panedwindow�PanedWindow�Progressbar�Radiobutton�Scale�	Scrollbar�	Separator�Sizegrip�Spinbox�Style�Treeview�LabeledScale�
OptionMenu�
tclobjs_to_py�setup_master�N)�_flatten�_join�
_stringify�
_splitdictg!@TFcCsBtr>ddl}|j�d�}|r,|j�d|�|j�d�d|_dS)NrZTILE_LIBRARYz(global auto_path; lappend auto_path {%s}zpackage require tileT)�
_REQUIRE_TILE�os�environ�get�tk�eval�_tile_loaded)�masterr Ztilelib�r'�#/usr/lib64/python3.8/tkinter/ttk.py�
_load_tile"s��r)cCs(|rt|�}nt|ttf�r$t|�}|S)zInternal function.)r�
isinstance�list�tupler)�value�scriptr'r'r(�_format_optvalue1s

r/cCsPg}|��D]:\}}|r ||kr|�d|�|dk	r|�t||��qt|�S)z�Formats optdict to a tuple to pass it to tk.call.

    E.g. (script=False):
      {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns:
      ('-foreground', 'blue', '-padding', '1 2 3 4')�-%sN)�items�appendr/r)Zoptdictr.�ignore�opts�optr-r'r'r(�_format_optdict;sr6cCsXg}|D]J�^}}t|�dkr,|dp(d}n
d�|�}|�|�|dk	r|�|�q|S)N�r�� )�len�joinr2)r1Zopt_val�state�valr'r'r(�_mapdict_valuesKs

r>cCs:g}|��D]$\}}|�d|tt|�|�f�qt|�S)z�Formats mapdict to pass it to tk.call.

    E.g. (script=False):
      {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]}

      returns:

      ('-expand', '{active selected} grey focus {1, 2, 3, 4}')r0)r1�extendr/r>r)Zmapdictr.r4r5r-r'r'r(�_format_mapdict`s

�r@cOs�d}d}|dkr�|dkrB|d}tt|dd���}d||f}n2|dd�\}}	tt|dd���}
d	||	|
f}t||�}n,|d
kr�|d}t|�dkr�t|d|�f}|r�d|}d�|�}||fS)
zAFormats args and kw according to the given element factory etype.Nr')�imageZvsapirArr7z%s %s�z%s %s %s�fromz{%s}r9)rr>r6r:r/r;)�etyper.�args�kw�specr4ZinameZ	imagespec�
class_nameZpart_idZstatemapr'r'r(�_format_elemcreateqs&
rIrBc
Cs�g}|D]�}|\}}|pi}d�t|dd��}dd|||rDd|ndf}d|kr�|�|d�||7}t|d||�\}	}|�|	�||8}|�d	d|�q|�|�qd
�|�|fS)a$Formats a layout list so we can pass the result to ttk::style
    layout and ttk::style settings. Note that the layout doesn't have to
    be a list necessarily.

    E.g.:
      [("Menubutton.background", None),
       ("Menubutton.button", {"children":
           [("Menubutton.focus", {"children":
               [("Menubutton.padding", {"children":
                [("Menubutton.label", {"side": "left", "expand": 1})]
               })]
           })]
       }),
       ("Menubutton.indicator", {"side": "right"})
      ]

      returns:

      Menubutton.background
      Menubutton.button -children {
        Menubutton.focus -children {
          Menubutton.padding -children {
            Menubutton.label -side left -expand 1
          }
        }
      }
      Menubutton.indicator -side rightr9T)�childrenz%s%s%sz %sr8rJz -children {z%s}�
)r;r6r2�_format_layoutlist)
�layout�indentZindent_sizer.Zlayout_elem�elemr4Zfopts�headZ	newscriptr'r'r(rL�s"
�
rLcCsXg}|��D�]>\}}|�d�rFd�t|dd��}|�d||f�|�d�rvd�t|dd��}|�d||f�d|kr�|ds�d}nt|d�\}}|�d	||f�|�d
�r|d
}|d}d}|t|�kr�t||d
�s�|d7}q�|d|�}	|t|�k�r||�r||ni}
t	|df|	�|
�\}}|�d||||f�qd�|�S)z�Returns an appropriate script, based on settings, according to
    theme_settings definition to be used by theme_settings and
    theme_create.�	configurer9Tzttk::style configure %s %s;�mapzttk::style map %s %s;rM�nullzttk::style layout %s {
%s
}zelement createrr7r1z%ttk::style element create %s %s %s %srK)
r1r"r;r6r2r@rLr:�hasattrrI)�settingsr.�namer4�s�_ZeoptsrDZargcZelemargsZelemkwrGr'r'r(�_script_from_settings�s:



$�
rYcCs�t|t�r|Sg}t|�}t||�D]j\}}t|d�rDt|���}n(t|t�rX|��}nt|ttf�sl|f}t|d�r~t|�}|�||f��q$|S)ztConstruct a list from the given statespec tuple according to the
    accepted statespec accepted by _format_mapdict.�typename)	r*�str�iter�ziprT�splitr,r+r2)Zstuple�result�itr<r=r'r'r(�_list_from_statespec�s




racCs�|�|�}g}d}|t|�kr�||}i}|�||f�|d7}|t|�kr|||d�\}}|�d�slq|dd�}|d7}|dkr�t||�}|||<q@q|S)zpConstruct a list from the tuple returned by ttk::layout, this is
    somewhat the reverse of _format_layoutlist.rr7rB�-NrJ)�	splitlistr:r2�
startswith�_list_from_layouttuple)r#Zltuple�resZindxrVr4r5r=r'r'r(res$


recGs4t|�}|j||�}t|�dr&|St||td�S)ahFormat options then call Tk command with args and options and return
    the appropriate result.

    If no option is specified, a dict is returned. If an option is
    specified with the None value, the value for that option is returned.
    Otherwise, the function just sets the passed options and the caller
    shouldn't be expecting a return value anyway.rB)�conv)r6�callr:r�
_tclobj_to_py)r#�optionsrErfr'r'r(�_val_or_dict!s
rkc	Cs2t|�}zt|�}Wnttfk
r,YnX|S)zAConverts a value to, hopefully, a more appropriate Python object.)r[�int�
ValueError�	TypeError)r-r'r'r(�_convert_stringval1srocCs(t|t�r$d|krt|�}nt|�}|S)N�.)r*r[�floatrl)�xr'r'r(�
_to_number;s


rscCs\|rFt|d�rFt|t�sFt|ddd�dkr6t|�}qXttt|��}nt|d�rXt|�}|S)z8Return value converted from Tcl object to Python object.�__len__rrZNZ	StateSpec)rTr*r[�getattrrar+rRro)r=r'r'r(riCs

ricCs"|��D]\}}t|�||<q|S)zOReturns adict with its values converted from Tcl objects to Python
    objects.)r1ri)Zadictr5r=r'r'r(rPscCs|dkrt��}|S)aIf master is not None, itself is returned. If master is None,
    the default master is returned if there is one, otherwise a new
    master is created and returned.

    If it is not allowed to use the default root and master is None,
    RuntimeError is raised.N)�tkinterZ_get_default_root)r&r'r'r(rXsc@s�eZdZdZdZddd�Zddd�Zddd	�Zdd
d�Zd dd
�Z	dd�Z
dd�Zdd�Zd!dd�Z
dd�Zdd�Zd"dd�ZdS)#rzManipulate style database.z
ttk::styleNcCs0t|�}t|dd�st|�||_|jj|_dS)Nr%F)rrur)r&r#)�selfr&r'r'r(�__init__is
zStyle.__init__cKs4|dk	rd||<t|j||jd|�}|s,|r0|SdS)z�Query or sets the default value of the specified option(s) in
        style.

        Each key in kw is an option and each value is either a string or
        a sequence identifying the value for that option.NrQ)rkr#�_name�rw�styleZ	query_optrFr_r'r'r(rQts
zStyle.configurecsj|dk	r0�j��jd|d|�}t�j�|��S�jj�jd|ft|���}�fdd�t�j|���D�S)aSQuery or sets dynamic values of the specified option(s) in
        style.

        Each key in kw is an option and each value should be a list or a
        tuple (usually) containing statespecs grouped in tuples, or list,
        or something else of your preference. A statespec is compound of
        one or more states and then a value.NrRr0cs"i|]\}}|t�j�|���qSr')rar#rc)�.0�k�v�rwr'r(�
<dictcomp>�s�zStyle.map.<locals>.<dictcomp>)r#rhryrarcr@rr1rzr'rr(rR�s
�z	Style.mapcCs.|rd�|�nd}|j�|jd|d|||�S)aReturns the value specified for option in style.

        If state is specified it is expected to be a sequence of one
        or more states. If the default argument is set, it is used as
        a fallback value in case no specification for option is found.r9r8�lookupr0)r;r#rhry)rwr{�optionr<�defaultr'r'r(r��s
�zStyle.lookupcCs>d}|rt|�d}n|dk	r"d}t|j|j�|jd||��S)a�Define the widget layout for given style. If layoutspec is
        omitted, return the layout specification for given style.

        layoutspec is expected to be a list or an object different than
        None that evaluates to False if you want to "turn off" that style.
        If it is a list (or tuple, or something else), each item should be
        a tuple where the first item is the layout name and the second item
        should have the format described below:

        LAYOUTS

            A layout can contain the value None, if takes no options, or
            a dict of options specifying how to arrange the element.
            The layout mechanism uses a simplified version of the pack
            geometry manager: given an initial cavity, each element is
            allocated a parcel. Valid options/values are:

                side: whichside
                    Specifies which side of the cavity to place the
                    element; one of top, right, bottom or left. If
                    omitted, the element occupies the entire cavity.

                sticky: nswe
                    Specifies where the element is placed inside its
                    allocated parcel.

                children: [sublayout... ]
                    Specifies a list of elements to place inside the
                    element. Each element is a tuple (or other sequence)
                    where the first item is the layout name, and the other
                    is a LAYOUT.NrrSrM)rLrer#rhry)rwr{Z
layoutspecZlspecr'r'r(rM�s �zStyle.layoutcOs8t|df|�|�\}}|jj|jdd|||f|��dS)z9Create a new element in the current theme of given etype.F�element�createN)rIr#rhry)rw�elementnamerDrErFrGr4r'r'r(�element_create�s��zStyle.element_createc	Cs(tdd�|j�|j�|jdd��D��S)z:Returns the list of elements defined in the current theme.css|]}|�d�VqdS�rbN��lstrip)r|�nr'r'r(�	<genexpr>�sz&Style.element_names.<locals>.<genexpr>r��names�r,r#rcrhryrr'r'r(�
element_names�s�zStyle.element_namesc
Cs*tdd�|j�|j�|jdd|��D��S)z)Return the list of elementname's options.css|]}|�d�VqdSr�r�)r|�or'r'r(r��sz(Style.element_options.<locals>.<genexpr>r�rjr�)rwr�r'r'r(�element_options�s�zStyle.element_optionsc
CsN|rt|�nd}|r2|j�|jdd|d|d|�n|j�|jdd|d|�dS)a.Creates a new theme.

        It is an error if themename already exists. If parent is
        specified, the new theme will inherit styles, elements and
        layouts from the specified parent theme. If settings are present,
        they are expected to have the same syntax used for theme_settings.r8�themer�z-parentz	-settingsN�rYr#rhry)rw�	themename�parentrUr.r'r'r(�theme_create�s��zStyle.theme_createcCs"t|�}|j�|jdd||�dS)a�Temporarily sets the current theme to themename, apply specified
        settings and then restore the previous theme.

        Each key in settings is a style and each value may contain the
        keys 'configure', 'map', 'layout' and 'element create' and they
        are expected to have the same format as specified by the methods
        configure, map, layout and element_create respectively.r�rUNr�)rwr�rUr.r'r'r(�theme_settings�szStyle.theme_settingscCs|j�|j�|jdd��S)z#Returns a list of all known themes.r�r�)r#rcrhryrr'r'r(�theme_names�szStyle.theme_namescCs&|dkr|j�d�S|j�d|�dS)z�If themename is None, returns the theme in use, otherwise, set
        the current theme to themename, refreshes all widgets and emits
        a <<ThemeChanged>> event.Nzreturn $ttk::currentThemez
ttk::setTheme)r#r$rh)rwr�r'r'r(�	theme_use�szStyle.theme_use)N)N)N)NN)N)NN)N)�__name__�
__module__�__qualname__�__doc__ryrxrQrRr�rMr�r�r�r�r�r�r�r'r'r'r(rds




+
c@s6eZdZdZddd�Zdd�Zddd�Zd
d	d
�ZdS)�Widgetz!Base class for Tk themed widgets.NcCs4t|�}t|dd�st|�tjj||||d�dS)a�Constructs a Ttk Widget with the parent master.

        STANDARD OPTIONS

            class, cursor, takefocus, style

        SCROLLABLE WIDGET OPTIONS

            xscrollcommand, yscrollcommand

        LABEL WIDGET OPTIONS

            text, textvariable, underline, image, compound, width

        WIDGET STATES

            active, disabled, focus, pressed, selected, background,
            readonly, alternate, invalid
        r%F)rFN)rrur)rvr�rx)rwr&Z
widgetnamerFr'r'r(rxszWidget.__init__cCs|j�|jd||�S)z�Returns the name of the element at position x, y, or the empty
        string if the point does not lie within any element.

        x and y are pixel coordinates relative to the widget.�identify�r#rh�_w�rwrr�yr'r'r(r�+szWidget.identifyc	Os6|j�|j�|jdd�|���}|r2|r2|||�S|S)a1Test the widget's state.

        If callback is not specified, returns True if the widget state
        matches statespec and False otherwise. If callback is specified,
        then it will be invoked with *args, **kw if the widget state
        matches statespec. statespec is expected to be a sequence.�instater9)r#�
getbooleanrhr�r;)rw�	statespec�callbackrErFZretr'r'r(r�3s�
zWidget.instatecCs0|dk	rd�|�}|j�t|j�|jd|���S)aModify or inquire widget state.

        Widget state is returned if statespec is None, otherwise it is
        set according to the statespec flags and then a new state spec
        is returned indicating which flags were changed. statespec is
        expected to be a sequence.Nr9r<)r;r#rcr[rhr�)rwr�r'r'r(r<Bs
zWidget.state)N)N)N)r�r�r�r�rxr�r�r<r'r'r'r(r�
s


r�c@s"eZdZdZddd�Zdd�ZdS)rzcTtk Button widget, displays a textual label and/or image, and
    evaluates a command when pressed.NcKst�||d|�dS)aConstruct a Ttk Button widget with the parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, default, width
        zttk::buttonN�r�rx�rwr&rFr'r'r(rxSszButton.__init__cCs|j�|jd�S)z/Invokes the command associated with the button.�invoker�rr'r'r(r�bsz
Button.invoke)N�r�r�r�r�rxr�r'r'r'r(rOs
c@s"eZdZdZddd�Zdd�ZdS)rz;Ttk Checkbutton widget which is either in on- or off-state.NcKst�||d|�dS)a'Construct a Ttk Checkbutton widget with the parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, offvalue, onvalue, variable
        zttk::checkbuttonNr�r�r'r'r(rxjszCheckbutton.__init__cCs|j�|jd�S)aWToggles between the selected and deselected states and
        invokes the associated command. If the widget is currently
        selected, sets the option variable to the offvalue option
        and deselects the widget; otherwise, sets the option variable
        to the option onvalue.

        Returns the result of the associated command.r�r�rr'r'r(r�yszCheckbutton.invoke)Nr�r'r'r'r(rgs
c@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)rzeTtk Entry widget displays a one-line text string and allows that
    string to be edited by the user.NcKst�|||pd|�dS)a�Constructs a Ttk Entry widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, xscrollcommand

        WIDGET-SPECIFIC OPTIONS

            exportselection, invalidcommand, justify, show, state,
            textvariable, validate, validatecommand, width

        VALIDATION MODES

            none, key, focus, focusin, focusout, all
        z
ttk::entryNr�)rwr&ZwidgetrFr'r'r(rx�szEntry.__init__cCs|�|j�|jd|��S)zqReturn a tuple of (x, y, width, height) which describes the
        bounding box of the character given by index.�bbox�Z_getintsr#rhr�)rw�indexr'r'r(r��sz
Entry.bboxcCs|j�|jd||�S)zxReturns the name of the element at position x, y, or the
        empty string if the coordinates are outside the window.r�r�r�r'r'r(r��szEntry.identifycCs|j�|j�|jd��S)z�Force revalidation, independent of the conditions specified
        by the validate option. Returns False if validation fails, True
        if it succeeds. Sets or clears the invalid state accordingly.�validate�r#r�rhr�rr'r'r(r��szEntry.validate)NN)r�r�r�r�rxr�r�r�r'r'r'r(r�s

c@s,eZdZdZd	dd�Zd
dd�Zdd�ZdS)rzMTtk Combobox widget combines a text field with a pop-down list of
    values.NcKstj||df|�dS)aConstruct a Ttk Combobox widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            exportselection, justify, height, postcommand, state,
            textvariable, values, width
        z
ttk::comboboxN�rrxr�r'r'r(rx�szCombobox.__init__cCs2|dkr |j�|j�|jd��S|j�|jd|�S)aIf newindex is supplied, sets the combobox value to the
        element at position newindex in the list of values. Otherwise,
        returns the index of the current value in the list of values
        or -1 if the current value does not appear in the list.N�current�r#Zgetintrhr�)rwZnewindexr'r'r(r��szCombobox.currentcCs|j�|jd|�dS)z(Sets the value of the combobox to value.�setNr��rwr-r'r'r(r��szCombobox.set)N)N)r�r�r�r�rxr�r�r'r'r'r(r�s


c@seZdZdZddd�ZdS)rzJTtk Frame widget is a container, used to group other widgets
    together.NcKst�||d|�dS)z�Construct a Ttk Frame with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            borderwidth, relief, padding, width, height
        z
ttk::frameNr�r�r'r'r(rx�szFrame.__init__)N�r�r�r�r�rxr'r'r'r(r�sc@seZdZdZddd�ZdS)rz7Ttk Label widget displays a textual label and/or image.NcKst�||d|�dS)aGConstruct a Ttk Label with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, style, takefocus, text,
            textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            anchor, background, font, foreground, justify, padding,
            relief, text, wraplength
        z
ttk::labelNr�r�r'r'r(rx�s
zLabel.__init__)Nr�r'r'r'r(r�sc@seZdZdZddd�ZdS)rz�Ttk Labelframe widget is a container used to group other widgets
    together. It has an optional label, which may be a plain text string
    or another widget.NcKst�||d|�dS)z�Construct a Ttk Labelframe with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS
            labelanchor, text, underline, padding, labelwidget, width,
            height
        zttk::labelframeNr�r�r'r'r(rx�szLabelframe.__init__)Nr�r'r'r'r(r�sc@seZdZdZddd�ZdS)r	zbTtk Menubutton widget displays a textual label and/or image, and
    displays a menu when pressed.NcKst�||d|�dS)aConstruct a Ttk Menubutton with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            direction, menu
        zttk::menubuttonNr�r�r'r'r(rxszMenubutton.__init__)Nr�r'r'r'r(r	
sc@sneZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zddd�Zdd�Z
dd�ZdS)r
z�Ttk Notebook widget manages a collection of windows and displays
    a single one at a time. Each child window is associated with a tab,
    which the user may select to change the currently-displayed window.NcKst�||d|�dS)a\Construct a Ttk Notebook with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            height, padding, width

        TAB OPTIONS

            state, sticky, padding, text, image, compound, underline

        TAB IDENTIFIERS (tab_id)

            The tab_id argument found in several methods may take any of
            the following forms:

                * An integer between zero and the number of tabs
                * The name of a child window
                * A positional specification of the form "@x,y", which
                  defines the tab
                * The string "current", which identifies the
                  currently-selected tab
                * The string "end", which returns the number of tabs (only
                  valid for method index)
        z
ttk::notebookNr�r�r'r'r(rx"szNotebook.__init__cKs |jj|jd|ft|���dS)z�Adds a new tab to the notebook.

        If window is currently managed by the notebook but hidden, it is
        restored to its previous position.�addN�r#rhr�r6)rw�childrFr'r'r(r�BszNotebook.addcCs|j�|jd|�dS)zXRemoves the tab specified by tab_id, unmaps and unmanages the
        associated window.�forgetNr��rw�tab_idr'r'r(r�JszNotebook.forgetcCs|j�|jd|�dS)z�Hides the tab specified by tab_id.

        The tab will not be displayed, but the associated window remains
        managed by the notebook and its configuration remembered. Hidden
        tabs may be restored with the add command.�hideNr�r�r'r'r(r�Psz
Notebook.hidecCs|j�|jd||�S)zZReturns the name of the tab element at position x, y, or the
        empty string if none.r�r�r�r'r'r(r�YszNotebook.identifycCs|j�|j�|jd|��S)z|Returns the numeric index of the tab specified by tab_id, or
        the total number of tabs if tab_id is the string "end".r�r�r�r'r'r(r�_szNotebook.indexcKs"|jj|jd||ft|���dS)z�Inserts a pane at the specified position.

        pos is either the string end, an integer index, or the name of
        a managed child. If child is already managed by the notebook,
        moves it to the specified position.�insertNr��rw�posr�rFr'r'r(r�eszNotebook.insertcCs|j�|jd|�S)z�Selects the specified tab.

        The associated child window will be displayed, and the
        previously-selected window (if different) is unmapped. If tab_id
        is omitted, returns the widget name of the currently selected
        pane.�selectr�r�r'r'r(r�nszNotebook.selectcKs$|dk	rd||<t|j||jd|�S)z�Query or modify the options of the specific tab_id.

        If kw is not given, returns a dict of the tab option values. If option
        is specified, returns the value of that option. Otherwise, sets the
        options to the corresponding values.N�tab�rkr#r�)rwr�r�rFr'r'r(r�xszNotebook.tabcCs|j�|j�|jd�pd�S)z2Returns a list of windows managed by the notebook.�tabsr'�r#rcrhr�rr'r'r(r��sz
Notebook.tabscCs|j�d|j�dS)a�Enable keyboard traversal for a toplevel window containing
        this notebook.

        This will extend the bindings for the toplevel window containing
        this notebook as follows:

            Control-Tab: selects the tab following the currently selected
                         one

            Shift-Control-Tab: selects the tab preceding the currently
                               selected one

            Alt-K: where K is the mnemonic (underlined) character of any
                   tab, will select that tab.

        Multiple notebooks in a single toplevel may be enabled for
        traversal, including nested notebooks. However, notebook traversal
        only works properly if all panes are direct children of the
        notebook.zttk::notebook::enableTraversalNr�rr'r'r(�enable_traversal�szNotebook.enable_traversal)N)N)N)r�r�r�r�rxr�r�r�r�r�r�r�r�r�r�r'r'r'r(r
s
 		


c@s>eZdZdZddd�ZejjZdd�Zddd�Z	d
d	d
�Z
dS)rzfTtk Panedwindow widget displays a number of subwindows, stacked
    either vertically or horizontally.NcKst�||d|�dS)z�Construct a Ttk Panedwindow with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient, width, height

        PANE OPTIONS

            weight
        zttk::panedwindowNr�r�r'r'r(rx�szPanedwindow.__init__cKs"|jj|jd||ft|���dS)z�Inserts a pane at the specified positions.

        pos is either the string end, and integer index, or the name
        of a child. If child is already managed by the paned window,
        moves it to the specified position.r�Nr�r�r'r'r(r��szPanedwindow.insertcKs$|dk	rd||<t|j||jd|�S)aQQuery or modify the options of the specified pane.

        pane is either an integer index or the name of a managed subwindow.
        If kw is not given, returns a dict of the pane option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values.N�paner�)rwr�r�rFr'r'r(r��szPanedwindow.panecCs|j�|j�|jd||��S)aLIf newpos is specified, sets the position of sash number index.

        May adjust the positions of adjacent sashes to ensure that
        positions are monotonically increasing. Sash positions are further
        constrained to be between 0 and the total size of the widget.

        Returns the new position of sash number index.�sashposr�)rwr�Znewposr'r'r(r��szPanedwindow.sashpos)N)N)N)r�r�r�r�rxrvrr�r�r�r�r'r'r'r(r�s
	
c@s6eZdZdZddd�Zddd�Zd
dd�Zd	d
�ZdS)r
a6Ttk Progressbar widget shows the status of a long-running
    operation. They can operate in two modes: determinate mode shows the
    amount completed relative to the total amount of work to be done, and
    indeterminate mode provides an animated display to let the user know
    that something is happening.NcKst�||d|�dS)z�Construct a Ttk Progressbar with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient, length, mode, maximum, value, variable, phase
        zttk::progressbarNr�r�r'r'r(rx�szProgressbar.__init__cCs|j�|jd|�dS)z�Begin autoincrement mode: schedules a recurring timer event
        that calls method step every interval milliseconds.

        interval defaults to 50 milliseconds (20 steps/second) if omitted.�startNr�)rwZintervalr'r'r(r��szProgressbar.startcCs|j�|jd|�dS)zRIncrements the value option by amount.

        amount defaults to 1.0 if omitted.�stepNr�)rwZamountr'r'r(r��szProgressbar.stepcCs|j�|jd�dS)zVStop autoincrement mode: cancels any recurring timer event
        initiated by start.�stopNr�rr'r'r(r�szProgressbar.stop)N)N)N)r�r�r�r�rxr�r�r�r'r'r'r(r
�s



c@s"eZdZdZddd�Zdd�ZdS)rzeTtk Radiobutton widgets are used in groups to show or change a
    set of mutually-exclusive options.NcKst�||d|�dS)aConstruct a Ttk Radiobutton with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, value, variable
        zttk::radiobuttonNr�r�r'r'r(rxszRadiobutton.__init__cCs|j�|jd�S)z�Sets the option variable to the option value, selects the
        widget, and invokes the associated command.

        Returns the result of the command, or an empty string if
        no command is specified.r�r�rr'r'r(r�szRadiobutton.invoke)Nr�r'r'r'r(rs
c@s.eZdZdZd	dd�Zd
dd�Zddd�ZdS)rzTtk Scale widget is typically used to control the numeric value of
    a linked variable that varies uniformly over some range.NcKst�||d|�dS)z�Construct a Ttk Scale with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            command, from, length, orient, to, value, variable
        z
ttk::scaleNr�r�r'r'r(rx'szScale.__init__cKsTtj||f|�}t|td�tf�s,|�|�td|kd|kd|kg�rP|�d�|S)z�Modify or query scale options.

        Setting a value for any of the "from", "from_" or "to" options
        generates a <<RangeChanged>> event.NrC�from_�to�<<RangeChanged>>)r�rQr*�typer[�update�anyZevent_generate)rwZcnfrFZretvalr'r'r(rQ5s

zScale.configurecCs|j�|jd||�S)z�Get the current value of the value option, or the value
        corresponding to the coordinates x, y if they are specified.

        x and y are pixel coordinates relative to the scale widget
        origin.r"r�r�r'r'r(r"Bsz	Scale.get)N)N)NN)r�r�r�r�rxrQr"r'r'r'r(r#s


c@seZdZdZddd�ZdS)rz;Ttk Scrollbar controls the viewport of a scrollable widget.NcKst�||d|�dS)z�Construct a Ttk Scrollbar with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            command, orient
        zttk::scrollbarNr�r�r'r'r(rxNszScrollbar.__init__)Nr�r'r'r'r(rKsc@seZdZdZddd�ZdS)rzITtk Separator widget displays a horizontal or vertical separator
    bar.NcKst�||d|�dS)z�Construct a Ttk Separator with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient
        zttk::separatorNr�r�r'r'r(rx`szSeparator.__init__)Nr�r'r'r'r(r\sc@seZdZdZddd�ZdS)rzlTtk Sizegrip allows the user to resize the containing toplevel
    window by pressing and dragging the grip.NcKst�||d|�dS)z�Construct a Ttk Sizegrip with parent master.

        STANDARD OPTIONS

            class, cursor, state, style, takefocus
        z
ttk::sizegripNr�r�r'r'r(rxrszSizegrip.__init__)Nr�r'r'r'r(rnsc@s"eZdZdZddd�Zdd�ZdS)rz�Ttk Spinbox is an Entry with increment and decrement arrows

    It is commonly used for number entry or to select from a list of
    string values.
    NcKstj||df|�dS)a/Construct a Ttk Spinbox widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, validate,
            validatecommand, xscrollcommand, invalidcommand

        WIDGET-SPECIFIC OPTIONS

            to, from_, increment, values, wrap, format, command
        zttk::spinboxNr�r�r'r'r(rx�szSpinbox.__init__cCs|j�|jd|�dS)z'Sets the value of the Spinbox to value.r�Nr�r�r'r'r(r��szSpinbox.set)N)r�r�r�r�rxr�r'r'r'r(r|s
c@s4eZdZdZdEdd�ZdFdd�ZdGdd�Zd	d
�ZdHdd�Zd
d�Z	dd�Z
dd�ZdIdd�ZdJdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�ZdKd#d$�ZdLd%d&�Zd'd(�ZeZd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!dMd=d>�Z"dNd?d@�Z#dOdAdB�Z$dPdCdD�Z%dS)Qrz�Ttk Treeview widget displays a hierarchical collection of items.

    Each item has a textual label, an optional image, and an optional list
    of data values. The data values are displayed in successive columns
    after the tree label.NcKst�||d|�dS)a�Construct a Ttk Treeview with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, xscrollcommand,
            yscrollcommand

        WIDGET-SPECIFIC OPTIONS

            columns, displaycolumns, height, padding, selectmode, show

        ITEM OPTIONS

            text, image, values, open, tags

        TAG OPTIONS

            foreground, background, font, image
        z
ttk::treeviewNr�r�r'r'r(rx�szTreeview.__init__cCs|�|j�|jd||��pdS)aTReturns the bounding box (relative to the treeview widget's
        window) of the specified item in the form x y width height.

        If column is specified, returns the bounding box of that cell.
        If the item is not visible (i.e., if it is a descendant of a
        closed item or is scrolled offscreen), returns an empty string.r�r8r�)rw�item�columnr'r'r(r��sz
Treeview.bboxcCs"|j�|j�|jd|pd�pd�S)zhReturns a tuple of children belonging to item.

        If item is not specified, returns root children.rJr8r'r��rwr�r'r'r(�get_children�s�zTreeview.get_childrencGs|j�|jd||�dS)z�Replaces item's child with newchildren.

        Children present in item that are not present in newchildren
        are detached from tree. No items in newchildren may be an
        ancestor of item.rJNr�)rwr�Znewchildrenr'r'r(�set_children�szTreeview.set_childrencKs$|dk	rd||<t|j||jd|�S)a
Query or modify the options for the specified column.

        If kw is not given, returns a dict of the column option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values.Nr�r�)rwr�r�rFr'r'r(r��szTreeview.columncGs|j�|jd|�dS)z_Delete all specified items and all their descendants. The root
        item may not be deleted.�deleteNr��rwr1r'r'r(r��szTreeview.deletecGs|j�|jd|�dS)z�Unlinks all of the specified items from the tree.

        The items and all of their descendants are still present, and may
        be reinserted at another point in the tree, but will not be
        displayed. The root item may not be detached.�detachNr�r�r'r'r(r��szTreeview.detachcCs|j�|j�|jd|��S)zSReturns True if the specified item is present in the tree,
        False otherwise.�existsr�r�r'r'r(r��szTreeview.existscCs|j�|jd|�S)z}If item is specified, sets the focus item to item. Otherwise,
        returns the current focus item, or '' if there is none.�focusr�r�r'r'r(r��szTreeview.focuscKsP|�d�}|r,t|t�s,|j�||j�|d<|dk	r<d||<t|j||jd|�S)a_Query or modify the heading options for the specified column.

        If kw is not given, returns a dict of the heading option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values.

        Valid options/values are:
            text: text
                The text to display in the column heading
            image: image_name
                Specifies an image to display to the right of the column
                heading
            anchor: anchor
                Specifies how the heading text should be aligned. One of
                the standard Tk anchor values
            command: callback
                A callback to be invoked when the heading label is
                pressed.

        To configure the tree column heading, call this with column = "#0" �commandN�heading)	r"r*r[r&�registerZ_substituterkr#r�)rwr�r�rF�cmdr'r'r(r��s
zTreeview.headingcCs|j�|jd|||�S)z�Returns a description of the specified component under the
        point given by x and y, or the empty string if no such component
        is present at that position.r�r�)rwZ	componentrrr�r'r'r(r�szTreeview.identifycCs|�dd|�S)z.Returns the item ID of the item at position y.�rowr�r�)rwr�r'r'r(�identify_rowszTreeview.identify_rowcCs|�d|d�S)zaReturns the data column identifier of the cell at position x.

        The tree column has ID #0.r�rr�)rwrrr'r'r(�identify_column"szTreeview.identify_columncCs|�d||�S)z�Returns one of:

        heading: Tree heading area.
        separator: Space between two columns headings;
        tree: The tree area.
        cell: A data cell.

        * Availability: Tk 8.6Zregionr�r�r'r'r(�identify_region)s	zTreeview.identify_regioncCs|�d||�S)zEReturns the element at position x, y.

        * Availability: Tk 8.6r�r�r�r'r'r(�identify_element5szTreeview.identify_elementcCs|j�|j�|jd|��S)zOReturns the integer index of item within its parent's list
        of children.r�r�r�r'r'r(r�<szTreeview.indexcKsNt|�}|dk	r0|jj|jd||d|f|��}n|jj|jd||f|��}|S)a�Creates a new item and return the item identifier of the newly
        created item.

        parent is the item ID of the parent item, or the empty string
        to create a new top-level item. index is an integer, or the value
        end, specifying where in the list of parent's children to insert
        the new item. If index is less than or equal to zero, the new node
        is inserted at the beginning, if index is greater than or equal to
        the current number of children, it is inserted at the end. If iid
        is specified, it is used as the item identifier, iid must not
        already exist in the tree. Otherwise, a new unique identifier
        is generated.Nr�z-id)r6r#rhr�)rwr�r�ZiidrFr4rfr'r'r(r�Bs
��zTreeview.insertcKs$|dk	rd||<t|j||jd|�S)a-Query or modify the options for the specified item.

        If no options are given, a dict with options/values for the item
        is returned. If option is specified then the value for that option
        is returned. Otherwise, sets the options to the corresponding
        values as given by kw.Nr�r�)rwr�r�rFr'r'r(r�Ysz
Treeview.itemcCs|j�|jd|||�dS)aRMoves item to position index in parent's list of children.

        It is illegal to move an item under one of its descendants. If
        index is less than or equal to zero, item is moved to the
        beginning, if greater than or equal to the number of children,
        it is moved to the end. If item was detached it is reattached.�moveNr�)rwr�r�r�r'r'r(r�esz
Treeview.movecCs|j�|jd|�S)zeReturns the identifier of item's next sibling, or '' if item
        is the last child of its parent.�nextr�r�r'r'r(r�qsz
Treeview.nextcCs|j�|jd|�S)zaReturns the ID of the parent of item, or '' if item is at the
        top level of the hierarchy.r�r�r�r'r'r(r�wszTreeview.parentcCs|j�|jd|�S)zjReturns the identifier of item's previous sibling, or '' if
        item is the first child of its parent.�prevr�r�r'r'r(r�}sz
Treeview.prevcCs|j�|jd|�dS)z�Ensure that item is visible.

        Sets all of item's ancestors open option to True, and scrolls
        the widget if necessary so that item is within the visible
        portion of the tree.�seeNr�r�r'r'r(r��szTreeview.seecCs|j�|j�|jd��S)z$Returns the tuple of selected items.�	selectionr�rr'r'r(r��szTreeview.selectioncCs>t|�dkr&t|dttf�r&|d}|j�|jd||�dS)Nr7rr�)r:r*r,r+r#rhr�)rwZselopr1r'r'r(�
_selection�szTreeview._selectioncGs|�d|�dS)z.The specified items becomes the new selection.r�N�r�r�r'r'r(�
selection_set�szTreeview.selection_setcGs|�d|�dS)z0Add all of the specified items to the selection.r�Nr�r�r'r'r(�
selection_add�szTreeview.selection_addcGs|�d|�dS)z5Remove all of the specified items from the selection.�removeNr�r�r'r'r(�selection_remove�szTreeview.selection_removecGs|�d|�dS)z2Toggle the selection state of each specified item.ZtoggleNr�r�r'r'r(�selection_toggle�szTreeview.selection_togglecCs@|j�|jd|||�}|dkr8|dkr8t|j|dtd�S|SdS)a;Query or set the value of given item.

        With one argument, return a dictionary of column/value pairs
        for the specified item. With two arguments, return the current
        value of the specified column. With three arguments, set the
        value of given column in given item to the specified value.r�NF)Z	cut_minusrg)r#rhr�rri)rwr�r�r-rfr'r'r(r��s�zTreeview.setcCs |j|jdd|f||dd�dS)z�Bind a callback for the given event sequence to the tag tagname.
        When an event is delivered to an item, the callbacks for each
        of the item's tags option are called.�tag�bindr)r�N)Z_bindr�)rw�tagnameZsequencer�r'r'r(�tag_bind�szTreeview.tag_bindcKs&|dk	rd||<t|j||jdd|�S)aBQuery or modify the options for the specified tagname.

        If kw is not given, returns a dict of the option settings for tagname.
        If option is specified, returns the value for that option for the
        specified tagname. Otherwise, sets the options to the corresponding
        values for the given tagname.Nr�rQr�)rwr�r�rFr'r'r(�
tag_configure�s
�zTreeview.tag_configurec	CsF|dkr$|j�|j�|jdd|��S|j�|j�|jdd||��SdS)z�If item is specified, returns 1 or 0 depending on whether the
        specified item has the given tagname. Otherwise, returns a list of
        all items which have the specified tag.

        * Availability: Tk 8.6Nr�Zhas)r#rcrhr�r�)rwr�r�r'r'r(�tag_has�s��zTreeview.tag_has)N)N)N)N)N)N)N)N)NN)NN)N)N)&r�r�r�r�rxr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zreattachr�r�r�r�r�r�r�r�r�r�r�r�r�r�r'r'r'r(r�sF



	
	

 

		



csLeZdZdZddd�Z�fdd�Zd	d
�Zedd��Zej	d
d��Z�Z
S)rz�A Ttk Scale widget with a Ttk Label widget indicating its
    current value.

    The Ttk Scale can be accessed through instance.scale, and Ttk Label
    can be accessed through instance.labelNr�
c	Ks|�dd�dk|_tj||f|�|p.t�|�|_|j�|�||_t	|�|_
t||j||d�|_|j�
d|j�|jr|dnd}|dkr�dnd}|jj|dd�t	|�}|j|d�|��|j
j|dkr�d	nd
d�|j�d|j�|_|�
d
|j�|�
d|j�dS)a�Construct a horizontal LabeledScale with parent master, a
        variable to be associated with the Ttk Scale widget and its range.
        If variable is not specified, a tkinter.IntVar is created.

        WIDGET-SPECIFIC OPTIONS

            compound: 'top' or 'bottom'
                Specifies how to display the label relative to the scale.
                Defaults to 'top'.
        Zcompound�top)�variabler�r�r�Zbottomrr)�sideZfill)r�r�rW)Zanchor�wz<Configure>z<Map>N)�pop�
_label_toprrxrvZIntVar�	_variabler��_last_validr�labelr�scaler��_adjustZpack�lowerZplaceZtrace_variable�_LabeledScale__tracecb)	rwr&r�r�r�rFZ
scale_sideZ
label_sideZdummyr'r'r(rx�s$
zLabeledScale.__init__csHz|j�d|j�Wntk
r(YnX|`t���d|_d|_dS)z9Destroy this widget and possibly its associated variable.r�N)r�Z
trace_vdeleter�AttributeError�super�destroyrrr��	__class__r'r(rs
zLabeledScale.destroycs��fdd�}t�jd�}t�jd�}||kr:||}}�j��}||krX|ksfn�j�_dS|�_|�jd<��|�dS)z1Adjust the label position according to the scale.csZ����j��\}}�jr2�j���j��}n�j���j��}�jj||d�dS)N�rrr�)Zupdate_idletasksrZcoordsr�Zwinfo_yrZwinfo_reqheightZplace_configurerrr'r(�adjust_labelsz*LabeledScale._adjust.<locals>.adjust_labelrCr�N�text)rsrr�r"rr-rZ
after_idle)rwrErr�r�Znewvalr'rr(rs


zLabeledScale._adjustcCs
|j��S)zReturn current scale value.)r�r"rr'r'r(r-4szLabeledScale.valuecCs|j�|�dS)zSet new scale value.N)r�r�)rwr=r'r'r(r-9s)NNrr�)r�r�r�r�rxrr�propertyr-�setter�
__classcell__r'r'r	r(r�s
&

cs<eZdZdZddd�Zdd�Zddd�Z�fd	d
�Z�ZS)
rzmThemed OptionMenu, based after tkinter's OptionMenu, which allows
    the user to select a value from a menu.NcOs�||�dd�|�dd�d�}tj||f|�tj|dd�|d<||_|�dd�|_|rpt�d	tt	|�
�����|j|f|��dS)
a9Construct a themed OptionMenu widget with master as the parent,
        the resource textvariable set to variable, the initially selected
        value specified by the default parameter, the menu values given by
        *values and additional keywords.

        WIDGET-SPECIFIC OPTIONS

            style: stylename
                Menubutton style.
            direction: 'above', 'below', 'left', 'right', or 'flush'
                Menubutton direction.
            command: callback
                A callback that will be invoked after selecting an item.
        r{N�	direction)Ztextvariabler{rF)Ztearoff�menur�zunknown option -%s)r�r	rxrvZMenur��	_callbackZTclErrorr�r\�keys�set_menu)rwr&r�r��values�kwargsrFr'r'r(rxCs
��zOptionMenu.__init__cCs&|dkr|�t�||��St�||�S)Nr)Znametowidgetr	�__getitem__r�r'r'r(r`szOptionMenu.__getitem__cGsR|d}|�dd�|D]$}|j|t�|j||j�|jd�q|rN|j�|�dS)zUBuild a new menu of radiobuttons with *values and optionally
        a default value.rr�end)rr�r�N)r�Zadd_radiobuttonrvZ_setitr�rr�)rwr�rrr=r'r'r(rgs�zOptionMenu.set_menucs,z|`Wntk
rYnXt���dS)z0Destroy this widget and its associated variable.N)r�rrrrr	r'r(rus
zOptionMenu.destroy)N)N)	r�r�r�r�rxrrrrr'r'r	r(r?s


)F)FN)F)F)rrB)N)6r��__version__�
__author__�__all__rvrrrrZ	TkVersionrr)r/r6r>r@rIrLrYrarerkrorsrirr�objectrr�rrrrrrrrr	r
rrr
rrrrrrZXViewZYViewrrrr'r'r'r(�<module>s��	




%
1*


*B*"8*(J`