Package: py-simple-ttk
py_simple_ttk 0.2.9Themes don't have to be hard.AboutRequirementsConfiguring ini.jsonThe App ObjectAppCore WidgetsMultiWidgetMixinSuperWidgetMixinTabsTabLauncherTabBrowserLauncherTabCommandLauncherTabConsoleTabTableTabTreeTableTabWidgetsButton WidgetsActiveButtonLabeledButtonLabeledMultiButtonCycleButtonLabeledCycleButtonLabeledMultiCycleButtonCore Functionsbbox_to_width_and_heightcenter_windowcheck_in_boundscomplex_widget_searchcopy_to_user_clipboardcreate_round_rectangledefault_packdefault_separatordefault_vertical_packdefault_vertical_separatorenable_notebook_movementfocus_nextforce_aspectget_assetget_bundled_themes_listget_generated_font_images_lookupget_local_appdata_folderget_themes_foldermake_aspect_framesmake_temp_config_fileopen_linkrecursive_widget_searchrun_clCanvas WidgetsResizableCanvasScrolledCanvasTiledCanvasExampleTileCheckbutton WidgetsActiveCheckbuttonLabeledCheckbuttonLabeledMultiCheckbuttonCombobox WidgetsActiveComboboxLabeledComboboxLabeledMultiComboboxConsole WidgetsConsoleWidgetConstraining Functionscheck_entry_typecheck_entry_intcheck_entry_floatcheck_entry_contentscheck_entry_ascii_lowercasecheck_entry_ascii_uppercasecheck_entry_ascii_letterscheck_entry_ascii_digitscheck_entry_ascii_uppercase_digitscheck_entry_ascii_lowercase_digitscheck_entry_ascii_hexdigitscheck_entry_ascii_octdigitscheck_entry_ascii_letters_digitscheck_entry_ascii_printableCounter WidgetsCounterFloatCounterLabeledCounterLabeledFloatCounterLabeledMultiCounterLabeledMultiFloatCounterEntry WidgetsActiveEntryScrolledEntryLabeledEntryLabeledMultiEntryLabeledButtonEntryLabeledMultiButtonEntryLabeledPathEntryLabeledMultiPathEntryPasswordEntryLabeledPasswordEntryLabeledMultiPasswordEntryConstrainedEntryLabeledConstrainedEntryLabeledMultiConstrainedEntryIntEntryLabeledIntEntryLabeledMultiIntEntryFloatEntryLabeledFloatEntryLabeledMultiFloatEntryLowercaseEntryLabeledLowercaseEntryLabeledMultiLowercaseEntryUppercaseEntryLabeledUppercaseEntryLabeledMultiUppercaseEntryLettersEntryLabeledLettersEntryLabeledMultiLettersEntryDigitsEntryLabeledDigitsEntryLabeledMultiDigitsEntryUppercaseDigitsEntryLabeledUppercaseDigitsEntryLabeledMultiUppercaseDigitsEntryLowercaseDigitsEntryLabeledLowercaseDigitsEntryLabeledMultiLowercaseDigitsEntryLettersDigitsEntryLabeledLettersDigitsEntryLabeledMultiLettersDigitsEntryHexdigitsEntryLabeledHexdigitsEntryLabeledMultiHexdigitsEntryOctdigitsEntryLabeledOctdigitsEntryLabeledMultiOctdigitsEntryPrintableEntryLabeledPrintableEntryLabeledMultiPrintableEntryFrame WidgetsColumnFrameHamburgerFrameKeyPad WidgetsKeypadButtonBaseKeypadDialerKeypadLabel WidgetsActiveLabelLabeledValueLabeler WidgetActiveButtonLabeledButtonLabeledMultiButtonCycleButtonLabeledCycleButtonLabeledMultiCycleButtonListBox WidgetsScrolledListBoxOrderedListboxListManipulatorTableOptionMenu WidgetsActiveOptionMenuLabeledOptionMenuLabeledMultiOptionMenuProgressBar WidgetsActiveProgressbarLabeledProgressbarLabeledMultiProgressbarRadiobutton WidgetsActiveRadiobuttonRadioTableLabeledRadioTableLabeledMultiRadioTableSimpleRadioTableLabeledSimpleRadioTableLabeledMultiSimpleRadioTableScale WidgetsActiveScaleLabeledScaleLabeledMultiScaleSpinbox WidgetsActiveSpinboxLabeledSpinboxLabeledMultiSpinboxText WidgetsScrolledTextCopyBoxLabeledCopyBoxLabeledMultiCopyBoxToplevel WidgetsFocusedToplevelNoticeWindowYesNoCancelWindowPromptWindowPasswordWindowListWindowTextWindowMisc WidgetsToolTipEasySizegripSuperLib.utilsUtilscheck_if_module_installedcheck_string_containsdummy_functionget_friendly_timeget_unix_timestampget_unix_timestringget_user_home_folderopen_folder_in_explorersort_dict_by_keystimer_decoratorFile GeneratorsHTML_GeneratorTXT_GeneratorMD_GeneratorHistory MixinHistoryMixinColor Functionsreduce_255rgb_to_hexrgba_to_hexhex_to_rgbhex_to_rgbaget_gradientrgb_to_scalarscalar_to_rgblinear_gradientget_rainbowMegaWidgetsNotes MegaWidgetNotesTabConversation MegaWidgetConversationsTabProfile ManagementProfilesSystemUserProfileget_profiles_folderget_profiles_listPIL-Only Widgets and FunctionsPIL-Only WidgetsGifLoaderGifViewerPIL-Only Functionsconvert_image_to_blackandwhiteconvert_image_to_grayscaleload_image_from_byte_arrayload_tk_image_from_bytes_arraymake_checkerboardChangelog0.2.90.2.80.2.70.2.60.2.50.2.40.2.30.2.20.2.10.2.00.1.420.1.410.1.400.1.390.1.380.1.370.1.360.1.350.1.340.1.330.1.320.1.310.1.300.1.290.1.280.1.270.1.260.1.250.1.240.1.230.1.220.1.210.1.200.1.190.1.180.1.170.1.160.1.150.1.140.1.130.1.120.1.110.1.100.1.90.1.80.1.70.1.60.1.50.1.40.1.30.1.20.1.10.1.0About^py_simple_ttk exists because I got tired of rewriting the same code over and over for simple projects. The goal is to provide a variety of meta widgets with consistent get/set/enable/disable/destroy methods and mega-widgets that make ttk development easier and faster. Features include built-in theme support, a score of labeled and multi-widgets, tools for easy form building, a sample application demonstrating many of py_simple_ttk's features, a configuration file system, and much more. Also contains a number of widgets and functions only available when PIL (an optional requirement) is installed.Requirements^['py_simple_lorem']Configuring ini.json^+------------------------+-------------------------------------------+
|        Key             |                   Value                   |
+------------------------+-------------------------------------------+
| application            | Application Name (String)                 |
| conversations_enabled  | Enable Convo System (Boolean)             |
| default_theme          | Default theme to use if available (String)|
| disable_notebook       | Disable default ttk.Notebook (Boolean)    |
| enable_fullscreen      | Enable Window Fullscreen option (Boolean) |
| enable_launcher        | Enable Dynamic Launcher System (Boolean)  |
| enable_maximized       | Enable Window Maximized (Boolean)         |
| enable_profiles        | Enable a User Profiles System (Boolean)   |
| enable_sizegrip        | Enable Window EasySizegrip (Boolean)      |
| enable_themes_menu     | Enable Themes Dropdown (Boolean)          |
| height                 | Startup Window Height (Int)               |
| icon                   | Application Icon Path (String)            |
| ignored_themes         | Themes to not display in menu (List)      |
| minheight              | Window Minimum Height (Int)               |
| minwidth               | Window Minimum Width (Int)                |
| movable_tabs           | Enable Moveable Notebook Tabs (Boolean)   |
| notes_enabled          | Enable Note System (Boolean)              |
| resizable_height       | Enable Window Height Resizing (Boolean)   |
| resizable_width        | Enable Window Width Resizing (Boolean)    |
| scale_minsize          | Scale application Minimum Size (Boolean)  |
| scale_startsize        | Scale application Start Size (Boolean)    |
| scaling                | Window Scaling (Float)                    |
| start_centered         | Center Window on launch (Boolean)         |
| start_fullscreen       | Start Window in Fullscreen mode (Boolean) |
| start_maximized        | Start Window Maximized (Boolean)          |
| theme_textboxes        | Apply theme colors to tk.Text (Boolean)   |
| version                | Application Version (String)              |
| width                  | Startup Window Width (Int)                |
+------------------------+-------------------------------------------+The App Object^App^Main Application ObjectclassApp(object):def__init__(self,ini_file:str):...defapply_profile(self,profile:src.py_simple_ttk.utils.ProfilesSystem.UserProfile)->str:"""Apply settings from the current profile. For more complicated profile systems override this function. `Returns the current theme as a String`"""defcopy_to_user_clipboard(self,val:str)->None:"""Copys a text val to the user's keyboard. `Returns None`"""defcreate_profile(self,name:str=None)->str|None:"""Calling with no name brings up a popup, the popup calls this function again with name kw which instead makes a new profile or asks again for a name if the supplied name was invalid. `Returns the current theme as a String on success or None`"""defget_scaling(self)->None:...defselect_profile(self,name:str=None)->str:"""Calling with no name brings up a popup, the popup calls this function again with the name which instead calls the Profiles System to use a certain profile. `Returns the current theme as a String`"""defstart(self)->None:"""Alias for App.mainloop(). `Never returns.`"""deftoggle_full_screen(self,event=None)->None:"""Toggles full screen. Returns None`"""deftoggle_maximized(self,event=None)->None:"""Toggles maximized window. Returns None`"""defupdate_default_title(self,indicate_profile=True)->None:"""Update the window title with the default string, optionally with a profile indicator. `Returns None`"""defupdate_title(self,title)->None:"""Updates the window title. `Returns None`"""defuse_theme(self,theme:str=None,verbose:bool=False)->str:"""Updates the app to use a certain theme. `Returns the current theme as a String`"""Core Widgets^MultiWidgetMixin^An abstract mixin that provides a way to easily instantiate multiple of the same class of a widget and making complicated forms with simple get/set methods.MultiWidgets support a simple get/set system. Calling get without a configuration list returns a dict of subwidget keys mapped to the values of each subwidget's .get value. Passing a list of subwidget keys limits MultiWidgetMixin.get to said subwidgets. Subclassing a multiwidget with one or more instances of one class and then calling multiwidget.add() with different classes after is acceptable assuming the widget supports being added and .get / .set / .enable / .disable / .clear methods.classMultiWidgetMixin(object):def__init__(self,widget_type:type,config:dict={},default_kwargs:dict={}):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""SuperWidgetMixin^Mixin to easily bind many of the common tkinter events.This class serves to add bindings for the majority of common tkinter widget events. The bindings are made in add mode to prevent previous / new bindings from causing unintended side-effects like unmapping etc.classSuperWidgetMixin(object):def__init__(self,on_mouse_enter:Callable=None,on_mouse_leave:Callable=None,on_mouse_move:Callable=None,on_mouse_wheel:Callable=None,on_left_click:Callable=None,on_double_left_click:Callable=None,on_middle_click:Callable=None,on_double_middle_click:Callable=None,on_right_click:Callable=None,on_double_right_click:Callable=None,on_configure:Callable=None):...Tabs^Tab^The core Tab class.The notebook object can be any ttk.Notebook, automatically adds itself to its parent notebook with title being the tab label. This class may be instantiated directly and added to or subclassed based on need.classTab(Frame):def__init__(self,notebook:tkinter.ttk.Notebook,title:str):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""LauncherTab^Basic Tab for launching tasks from a list.Performs an action on a list of options. The options argument is formatted as such:options = {"Button Text 1": val1,"Button Text 2": val2}Button presses will callaction(val)classLauncherTab(Tab):def__init__(self,notebook:tkinter.ttk.Notebook,title:str,options:dict,action:Callable):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""BrowserLauncherTab^LauncherTab that opens a list of URLS/FilesTakes a dict of button texts as keys and urls to open as valuesclassBrowserLauncherTab(LauncherTab):def__init__(self,notebook:tkinter.ttk.Notebook,title:str,options:dict):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""CommandLauncherTab^LauncherTab that runs a list of commandsTakes a dict of button texts as keys and command prompt commands to execute as valuesclassCommandLauncherTab(LauncherTab):def__init__(self,notebook:tkinter.ttk.Notebook,title:str,options:dict):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""ConsoleTab^Basic console tab using a ConsoleWidgetclassConsoleTab(Tab):def__init__(self,notebook:tkinter.ttk.Notebook,**kwargs):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""TableTab^Basic Table Tabtable_contents is a dictionary whose keys map to lists of equal lengths with the column contentsclassTableTab(Tab):def__init__(self,notebook:tkinter.ttk.Notebook,title:str,table_contents:dict,**kw):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""TreeTableTab^Improved Table Tabtable_contents is a dictionary whose keys map to lists of equal lengths with the column contentsclassTreeTableTab(Tab):def__init__(self,notebook:tkinter.ttk.Notebook,title:str,table_contents:dict={},**kw):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""Widgets^Button Widgets^ActiveButton^ttk.Button with added featuresclassActiveButton(Button,SuperWidgetMixin):def__init__(self,parent,default:str='',command:Callable=None,widgetargs:dict={},**kw):...defclear(self)->None:"""Set button text to default"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable button"""defenable(self)->None:"""Enable button"""defget(self)->str:"""Get button text"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set button text"""LabeledButton^Labeled ActiveButton widgetclassLabeledButton(Labeler,ActiveButton):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,command:Callable='',default:str='',is_child:bool=False,labelside:str='left',**kw):...defclear(self)->None:"""Set button text to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable button"""defenable(self)->None:"""Enable button"""defget(self)->str:"""Get button text"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set button text"""LabeledMultiButton^Labeled MultiWidget LabeledButton.Used when you need multiple, vertically stacked Labeled ActiveButtonsclassLabeledMultiButton(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""CycleButton^ActiveButton that cycles through options on each clickclassCycleButton(ActiveButton):def__init__(self,parent:tkinter.ttk.Frame,options:list,default:int=0,command:Callable=None,**kw):...defclear(self,event=None):...defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable button"""defenable(self)->None:"""Enable button"""defget(self)->str:"""Get button text"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set button text"""LabeledCycleButton^Labeled CycleButton widgetclassLabeledCycleButton(Labeler,CycleButton):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,options:list,is_child:bool=False,labelside:str='left',**kw):...defclear(self,event=None):...defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable button"""defenable(self)->None:"""Enable button"""defget(self)->str:"""Get button text"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set button text"""LabeledMultiCycleButton^Labeled MultiWidget LabeledCycleButtonUsed when you need multiple, vertically stacked Labeled CycleButtonsclassLabeledMultiCycleButton(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""Core Functions^bbox_to_width_and_height^Takes a bbox and converts it to a width and height tuple.defbbox_to_width_and_height(bbox:tuple)->tuple:>...center_window^Centers spawn window on main window. Call win.update_idletasks() on either window before calling this if said window is not yet shown.defcenter_window(main_window:tkinter.Tk,spawn_window:tkinter.Toplevel)->None:>...check_in_bounds^Checks if a position is within a given bounds. Pos is generally a mouse event position tuple, bounds is generally a canvas.bbox(), but a (left, top, right, bottom) tuple will work too.defcheck_in_bounds(pos:tuple,bounds:tuple)->bool:>...complex_widget_search^A more robust version of the widget search with lists for multiple widget types found in one godefcomplex_widget_search(node_widget,widget_types_to_find:list|tuple,found_lists:dict={})->dict:>...copy_to_user_clipboard^Copies a string to the user's clipboard.defcopy_to_user_clipboard(widget,value:str)->None:>...create_round_rectangle^Draws a rounded rectangle of a given radius on a tk.canvasdefcreate_round_rectangle(canvas,x1:float,y1:float,x2:float,y2:float,r:float=20,fill:str='',outline:str='#000000',**kwargs):>...default_pack^Apply a consistent descending packing method.defdefault_pack(widget,bottom:bool=False,padx:tuple=5)->None:>...default_separator^Apply a consistent horizontal separator.defdefault_separator(f:tkinter.ttk.Frame,padx:tuple=35,pady:tuple=(10,5))->tkinter.ttk.Separator:>...default_vertical_pack^Apply a consistent packing method to vertically packed widgets.defdefault_vertical_pack(widget,expand:bool=False,fill:str='both',padx:tuple=0)->None:>...default_vertical_separator^Apply a consistent vertical separator.defdefault_vertical_separator(frame:tkinter.ttk.Frame,pady:tuple=15,padx:tuple=10)->tkinter.ttk.Separator:>...enable_notebook_movement^Copyright CJB 2010-07-31:https://wiki.tcl-lang.org/page/Drag+and+Drop+Notebook+TabsEnables Tab dragging in subsequently created notebooks. Only run this function once.defenable_notebook_movement(app)->None:>...focus_next^Forces focus to the widget after the one that triggered the eventdeffocus_next(event)->object:>...force_aspect^Forces an inner frame to maintain an aspect ratio regardless of the outer frame's sizedefforce_aspect(inner_frame:tkinter.ttk.Frame,outer_frame:tkinter.ttk.Frame,ratio:float=1.7777777777777777)->None:>...get_asset^Gets an asset from the included assets folder by relative path. Works with pyinstaller.defget_asset(path,folder:str='C:\\Users\\arcti\\GitHub\\py_simple_ttk\\src\\py_simple_ttk\\./assets')->str:>...get_bundled_themes_list^Nonedefget_bundled_themes_list(verbose:bool=False)->list:>...get_generated_font_images_lookup^Makes a lookup for the pre-generated open-sans font monograms that ship with py_simple_ttk.defget_generated_font_images_lookup(path:str=None)->dict:>...get_local_appdata_folder^Opens user's Windows home folder. Only works on Windows for obvious reasons.defget_local_appdata_folder()->str:>...get_themes_folder^Gets the absolute path to the included themes folderdefget_themes_folder()->str:>...make_aspect_frames^Creates an outer and inner frame within a parent frame. Forces the inner frame to maintain an aspect ratio. Returns the outer and inner frames.defmake_aspect_frames(parent:tkinter.ttk.Frame,ratio:float=1.7777777777777777)->tuple:>...make_temp_config_file^Make a one-time-use app config file from a dict in the same form as a normal config json.Returns file path as Stringdefmake_temp_config_file(config:dict):>...open_link^Opens a link in the user's default web browser.Returns Nonedefopen_link(link:str)->None:>...recursive_widget_search^**
Adds widgets of a given type to a list as it travels up,
away from the root of a widget tree. This method can be slow on
large widget trees but is useful for retheming tk widgets with
ttk formatting on theme changes.Returns a list of widgets**defrecursive_widget_search(node_widget,widget_type_to_find:type,found_list:list=[])->list:>...run_cl^Runs something via command line.Returns Nonedefrun_cl(commands:list)->None:>...Canvas Widgets^ResizableCanvas^Resizeable CanvasCanvas resizes to fit frame on configure event.classResizableCanvas(Canvas):def__init__(self,parent,**kw):...defcreate_arc(self,*args,**kw):"""Create arc shaped region with coordinates x1,y1,x2,y2."""defcreate_bitmap(self,*args,**kw):"""Create bitmap with coordinates x1,y1."""defcreate_image(self,*args,**kw):"""Create image item with coordinates x1,y1."""defcreate_line(self,*args,**kw):"""Create line with coordinates x1,y1,...,xn,yn."""defcreate_oval(self,*args,**kw):"""Create oval with coordinates x1,y1,x2,y2."""defcreate_polygon(self,*args,**kw):"""Create polygon with coordinates x1,y1,...,xn,yn."""defcreate_rectangle(self,*args,**kw):"""Create rectangle with coordinates x1,y1,x2,y2."""defcreate_round_rectangle(self,x1:float,y1:float,x2:float,y2:float,r:float=20,fill:str='',outline:str='#000000',**kwargs)->None:"""Draws a rounded rectangle of a given radius on a tk.canvas."""defcreate_text(self,*args,**kw):"""Create text with coordinates x1,y1."""defcreate_window(self,*args,**kw):"""Create window with coordinates x1,y1,x2,y2."""defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defrefresh(self)->None:"""Refresh Canvas"""ScrolledCanvas^Resizeable, Auto-Scrollbarred CanvasCanvas resizes to fit frame on configure event. Canvas has automatic Scrollbars that appear when needed. Canvas background color is based on current theme. Due to how the scrolling is handled the actual Canvas is accessd viaScrolledCanvas().canvas.classScrolledCanvas(Frame):def__init__(self,parent,on_mouse_enter=None,on_mouse_leave=None,on_mouse_move=None,on_mouse_wheel=None,on_left_click=None,on_middle_click=None,on_right_click=None,on_configure=None,configure_delay:int=100,bind_canvas_scroll=True,**kw):...defdestroy(self):"""Destroy this and all descendants widgets."""defget_adjusted_y_view(self,event)->int:"""Gets a canvas y-view adjusted based on its scrolled position"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defuse_style(self,style)->None:"""Reformat with a given ttk style. `Returns None`"""TiledCanvas^classTiledCanvas(ScrolledCanvas):def__init__(self,*args,tile_width=400,tile_height=100,tile_padx=5,tile_pady=5,tile_color='#424548',text_color='#CCCCCC',border_color='#000000',on_tile_left_click=None,on_tile_middle_click=None,on_tile_right_click=None,override_tile_width=False,**kw):...defdestroy(self):"""Destroy this and all descendants widgets."""defget_adjusted_y_view(self,event)->int:"""Gets a canvas y-view adjusted based on its scrolled position"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defrefresh(self,event=None)->None:"""Redraw the canvas"""defuse_style(self,style)->None:"""Reformat with a given ttk style. `Returns None`"""ExampleTile^An example tile for a Scrolled CanvasclassExampleTile(object):def__init__(self,manager,text:str):...defactivate(self)->None:"""Calls the manager to activate the widget."""defdeactivate(self)->None:"""Calls the manager to deactivate the widget."""defis_in_range(self,pointer_x:float,pointer_y:float)->bool:"""Checks if the mouse pointer is in the tile."""defset_position(self,x:float,y:float)->None:"""Sets a tiles position for the draw manager's draw method."""Checkbutton Widgets^ActiveCheckbutton^ttk.Checkbutton with added featuresThe "replace_output" keyword argument allows the user to provide a tuple of length 2 to replace the default True/False return values.classActiveCheckbutton(Checkbutton):def__init__(self,parent:tkinter.ttk.Frame,replace_output:list=None,default:bool=False,**kw):...defclear(self)->None:"""Sets the Checkbutton to its default value, usually *False* `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Checkbutton. `Returns None`"""defenable(self)->None:"""Enable Checkbutton. `Returns None`"""defget(self)->bool:"""Get Checkbutton value. `Returns a Boolean unless replace_output is set`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:bool)->None:"""Set Checkbutton value. `Returns None`"""LabeledCheckbutton^Labeled CheckbuttonActiveCheckbutton with a LabelclassLabeledCheckbutton(Labeler,ActiveCheckbutton):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str='',is_child:bool=False,**kw):...defclear(self)->None:"""Sets the Checkbutton to its default value, usually *False* `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Checkbutton. `Returns None`"""defenable(self)->None:"""Enable Checkbutton. `Returns None`"""defget(self)->bool:"""Get Checkbutton value. `Returns a Boolean unless replace_output is set`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:bool)->None:"""Set Checkbutton value. `Returns None`"""LabeledMultiCheckbutton^Labeled MultiWidget LabeledCheckbutton.Used when you need multiple, vertically stacked Labeled CheckbuttonsclassLabeledMultiCheckbutton(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""Combobox Widgets^ActiveCombobox^ttk.Combobox with added features and the SuperWidgetMixinclassActiveCombobox(Combobox,SuperWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,command:Callable=None,default:int=0,on_keystroke:bool=False,bind_enter:bool=True,bind_escape_clear:bool=True,values:list=(),custom_values:bool=True,widgetargs:dict={},**kw):...defclear(self)->None:"""Sets Combobox to its default value. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Combobox. `Returns None`"""defenable(self)->None:"""Enable Combobox. `Returns None`"""defget(self)->str:"""Get Combobox value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set Combobox value. `Returns None`"""LabeledCombobox^Labeled Combobox with the Super Widget mixinSet custom_values keyword to "False" to disable custom user-entered values. Set the "default" keyword to the index of the value to display by default from the "values" keyword.classLabeledCombobox(Labeler,ActiveCombobox):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,labelside:str='left',is_child:bool=False,widgetargs={},**kw):...defclear(self)->None:"""Sets Combobox to its default value. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Combobox. `Returns None`"""defenable(self)->None:"""Enable Combobox. `Returns None`"""defget(self)->str:"""Get Combobox value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set Combobox value. `Returns None`"""LabeledMultiCombobox^Labeled MultiWidget LabeledCombobox.Used when you need mutiple, vertically stacked Labeled ComboboxesclassLabeledMultiCombobox(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""Console Widgets^ConsoleWidget^Set labeltext, even if temporarily at init or the label widget will be ignoredUsed when you need to drop a console interface into an application. To write to the console call console.print(value). Pass a function as the "command" keyword argument to handle the entry input.classConsoleWidget(Labeler,Frame):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str='Console: ',entrylabeltext:str='Command: ',labelside:str='top',button_text:str='Run',is_child:bool=False,**kwargs):...defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defprint(self,val,end:str='\n'):"""Prints a line to the console with a customizable line ending. `Returns None`"""Constraining Functions^check_entry_type^Core type checker function. Limits entry to chars that construct a given typedefcheck_entry_type(val:str,typ:type)->bool:>...check_entry_int^Check if an entry input is a valid integerdefcheck_entry_int(val:str)->bool:>...check_entry_float^Check if an entry input is a valid floatdefcheck_entry_float(val:str)->bool:>...check_entry_contents^Core content checker function. Limits entry to a list of chars ['a', 'b', 'c', ...] or     the chars contained in a simple string 'abc...'defcheck_entry_contents(val:str,limiter:list|str)->bool:>...check_entry_ascii_lowercase^Check if entry input is made only of lowercase asciidefcheck_entry_ascii_lowercase(val:str)->bool:>...check_entry_ascii_uppercase^Check if entry input is made only of uppercase asciidefcheck_entry_ascii_uppercase(val:str)->bool:>...check_entry_ascii_letters^Check if entry input is made only of uppercase and lowercase asciidefcheck_entry_ascii_letters(val:str)->bool:>...check_entry_ascii_digits^Check if entry input is made only of digitsdefcheck_entry_ascii_digits(val:str)->bool:>...check_entry_ascii_uppercase_digits^Check if entry input is made only of uppercase ascii and digitsdefcheck_entry_ascii_uppercase_digits(val:str)->bool:>...check_entry_ascii_lowercase_digits^Check if entry input is made only of lowercase ascii and digitsdefcheck_entry_ascii_lowercase_digits(val:str)->bool:>...check_entry_ascii_hexdigits^Check if entry input is made only of hexigitsdefcheck_entry_ascii_hexdigits(val:str)->bool:>...check_entry_ascii_octdigits^Check if entry input is made only of octdigitsdefcheck_entry_ascii_octdigits(val:str)->bool:>...check_entry_ascii_letters_digits^Check if entry input is made only of ascii lowercase, ascii uppercase, and digitsdefcheck_entry_ascii_letters_digits(val)->bool:>...check_entry_ascii_printable^Check if entry input is made only of printable charactersdefcheck_entry_ascii_printable(val:str)->bool:>...Counter Widgets^Counter^Up / down counter widgetsclassCounter(Frame):def__init__(self,parent:tkinter.ttk.Frame,default:int=0,min_value:int=None,max_value:int=None,step:int=1,state:str='normal',command:Callable=None,depth:int=1,**kwargs):...defclear(self)->int:...defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:...defenable(self)->None:...definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:int,adjust:int=0,no_command:bool=False)->int:...FloatCounter^Float Counter WidgetclassFloatCounter(Frame):def__init__(self,parent=<class'tkinter.ttk.Frame'>, default: float = 0.0, min_value: float = None, max_value: float = None, step: float = 1.0, state: str = 'normal', command: Callable = None, decimal_level: int = 1, integer_level: int = 1, **kwargs):...defclear(self)->float:...defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:...defenable(self)->None:...defget(self)->float:...definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:float,adjust:float=0.0)->float:...LabeledCounter^Labeled Counter WidgetclassLabeledCounter(Labeler,Counter,SuperWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,command:Callable=None,labelside:str='left',is_child:bool=False,state:str='normal',widgetargs:dict={},**kw):...defclear(self)->int:...defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:...defenable(self)->None:...definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:int,adjust:int=0,no_command:bool=False)->int:...LabeledFloatCounter^Labeled Float Counter WidgetclassLabeledFloatCounter(Labeler,FloatCounter,SuperWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,command:Callable=None,labelside:str='left',is_child:bool=False,state:str='normal',widgetargs:dict={},**kw):...defclear(self)->float:...defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:...defenable(self)->None:...defget(self)->float:...definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:float,adjust:float=0.0)->float:...LabeledMultiCounter^Labeled MultiWidget LabeledCounter.Used when you need multiple, vertically stacked Labeled CountersclassLabeledMultiCounter(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""LabeledMultiFloatCounter^Labeled MultiWidget Labeled FloatCounter.Used when you need multiple, vertically stacked Labeled FloatCountersclassLabeledMultiFloatCounter(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""Entry Widgets^ActiveEntry^Active ttk.Entry with added features and the SuperWidgetMixinclassActiveEntry(Entry,SuperWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,command:Callable=None,default:str='',on_keystroke:bool=False,bind_enter:bool=True,bind_escape_clear:bool=True,widgetargs:dict={},**kw):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->str:"""Get Entry value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""ScrolledEntry^Scrolled ttk.Entry with SuperWidgetMixinThis class is here for completeness but most of the time you will want to use the ScrolledText widget. Used when you need a scrollable text entry box.classScrolledEntry(Scroller,ActiveEntry):def__init__(self,parent,**kw)->object:...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->str:"""Get Entry value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledEntry^Labeled ActiveEntryActiveEntry with LabelclassLabeledEntry(Labeler,ActiveEntry):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,labelside:str='left',is_child:bool=False,**kw):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->str:"""Get Entry value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiEntry^Labeled MultiWidget LabeledEntryUsed when you need multiple, vertically stacked Labeled EntriesclassLabeledMultiEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""LabeledButtonEntry^LabeledEntry with a ttk.Button on the rightclassLabeledButtonEntry(LabeledEntry):def__init__(self,*args,button_text='',**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->str:"""Get Entry value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiButtonEntry^Labeled MultiWidget Labeled ButtonEntryUsed when you need multiple, vertically stacked Labeled EntriesclassLabeledMultiButtonEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""LabeledPathEntry^LabeledEntry with a ttk.Button bound to a file- or folder-picker for easy     system path selection. Defaults to tk.filedialog.askopenfilename if no     tk.filedialog specified.classLabeledPathEntry(LabeledEntry):def__init__(self,*args,button_text:str='...',dialog=None,dialog_args:dict={},**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->str:"""Get Entry value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiPathEntry^Labeled MultiWidget LabeledPathEntryUsed when you need multiple, vertically stacked LabeledPathEntriesclassLabeledMultiPathEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""PasswordEntry^Username / Password EntryA username/password entry widget with optional password peeking. Set password_char to''to show password by default. The provided command will always be called with the tuple(username_entry.get(), password_entry.get())as the only argument even if one of the entries is disabled.classPasswordEntry(Frame):def__init__(self,*args,instruction_text:str='',username_text:str='Username: ',username_enabled:bool=True,password_text:str='Password: ',password_enabled:bool=True,button_text:str='Submit',command=<built-infunctionprint>,password_char:str='*',peek_enabled:bool=True,invert_peek_colors:bool=False,**kwargs):...defdestroy(self):"""Destroy this and all descendants widgets."""defget(self)->tuple:...definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,values:tuple)->None:...LabeledPasswordEntry^Labeled Username/Password entryclassLabeledPasswordEntry(Labeler,PasswordEntry):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,*args,is_child:bool=False,**kw):...defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defget(self)->tuple:...definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,values:tuple)->None:...LabeledMultiPasswordEntry^Labeled MultiWidget Labeled PasswordEntryUsed when you need multiple, vertically stacked Labeled Username/Password EntriesclassLabeledMultiPasswordEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""ConstrainedEntry^Constrained ActiveEntryAn Entry widget that allows certain constraints to be placed on the input with a given check_function that returns true if the input is allowed for each keystroke / input.classConstrainedEntry(ActiveEntry):def__init__(self,parent:tkinter.ttk.Frame,check_function:Callable,return_type:type=<class'str'>, **kw):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledConstrainedEntry^Labeled Constrained EntryclassLabeledConstrainedEntry(Labeler,ConstrainedEntry):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,*args,is_child:bool=False,**kw):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiConstrainedEntry^Labeled Multi Constrained EntryclassLabeledMultiConstrainedEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""IntEntry^Int Entry WidgetclassIntEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->int:"""Get IntEntry value, `Returns an Int`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledIntEntry^Labeled Int Entry WidgetclassLabeledIntEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->int:"""Get IntEntry value, `Returns an Int`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiIntEntry^classLabeledMultiIntEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""FloatEntry^classFloatEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledFloatEntry^classLabeledFloatEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiFloatEntry^classLabeledMultiFloatEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""LowercaseEntry^classLowercaseEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledLowercaseEntry^classLabeledLowercaseEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiLowercaseEntry^classLabeledMultiLowercaseEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""UppercaseEntry^classUppercaseEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledUppercaseEntry^classLabeledUppercaseEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiUppercaseEntry^classLabeledMultiUppercaseEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""LettersEntry^classLettersEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledLettersEntry^classLabeledLettersEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiLettersEntry^classLabeledMultiLettersEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""DigitsEntry^classDigitsEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledDigitsEntry^classLabeledDigitsEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiDigitsEntry^classLabeledMultiDigitsEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""UppercaseDigitsEntry^classUppercaseDigitsEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledUppercaseDigitsEntry^classLabeledUppercaseDigitsEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiUppercaseDigitsEntry^classLabeledMultiUppercaseDigitsEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""LowercaseDigitsEntry^classLowercaseDigitsEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledLowercaseDigitsEntry^classLabeledLowercaseDigitsEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiLowercaseDigitsEntry^classLabeledMultiLowercaseDigitsEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""LettersDigitsEntry^classLettersDigitsEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledLettersDigitsEntry^classLabeledLettersDigitsEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiLettersDigitsEntry^classLabeledMultiLettersDigitsEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""HexdigitsEntry^classHexdigitsEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledHexdigitsEntry^classLabeledHexdigitsEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiHexdigitsEntry^classLabeledMultiHexdigitsEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""OctdigitsEntry^classOctdigitsEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledOctdigitsEntry^classLabeledOctdigitsEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiOctdigitsEntry^classLabeledMultiOctdigitsEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""PrintableEntry^classPrintableEntry(ConstrainedEntry):def__init__(self,parent,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledPrintableEntry^classLabeledPrintableEntry(LabeledConstrainedEntry):def__init__(self,parent,labeltext,*args,**kwargs):...defclear(self)->None:"""Set Entry value to default, empty unless default set. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Entry. `Returns None`"""defenable(self)->None:"""Enable Entry. `Returns None`"""defget(self)->object:"""Get Entry value, return type varies based on Entry constraint."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set Entry value. `Returns None`"""LabeledMultiPrintableEntry^classLabeledMultiPrintableEntry(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""Frame Widgets^ColumnFrame^A frame with a given number of children column ttk.FramesTakes a number of columns or a list of names when thelabeledkeyword is set to TrueclassColumnFrame(Frame):def__init__(self,parent:tkinter.ttk.Frame,columns:int|list=1,labeled=False,pack_args:dict={},**kw):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defyield_frame(self):"""Cyclically returns frames"""HamburgerFrame^A ttk.Frame with a Hamburger Menu and supporting widgetsOptions is an iterable in the form ((label, callback), (label2, callback2), ...). See examples/hamburger_demo.py for usage.classHamburgerFrame(Frame):def__init__(self,parent:tkinter.ttk.Frame,options:collections.abc.Iterable,menu_width:int=300,column_style='Hamburger.TFrame',**kw):...defclose(self,event=None)->None:"""Closes the menu. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defopen(self,event=None)->None:"""Opens the menu. `Returns None`"""KeyPad Widgets^KeypadButton^Base Keypad ButtonKeypad button that automatically packs itself based on given coordinates. This object is not usually directly instantiated.classKeypadButton(Button):def__init__(self,frame:tkinter.ttk.Frame,value:int,coords:tuple,command:Callable):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""BaseKeypad^Base Keypad ClassEither instantiate directly with a custom layout or subclass with each subclass supplying a custom layout for more keypads. Subclass KeypadButton and supply the class as the "button_type" kwarg for custom buttons.classBaseKeypad(Frame):def__init__(self,layout,command,button_class=<class'src.py_simple_ttk.widgets.KeyPadWidgets.KeypadButton'>, *args, **kwargs):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""DialerKeypad^Phone Dialer KeypadExample 12-button keypad, subclass BaseKeypad and supply a custom layout for more keypads.classDialerKeypad(BaseKeypad):def__init__(self,command:Callable,*args,**kwargs):...defdestroy(self):"""Destroy this and all descendants widgets."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""Label Widgets^ActiveLabel^Active ttk.Entry with added features and the SuperWidgetMixinclassActiveLabel(Label,SuperWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,command:Callable=None,default:str='',widgetargs:dict={},**kw):...defclear(self)->None:"""Set label value to default, empty unless default set. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable label updates. `Returns None`"""defenable(self)->None:"""Enable label updates. `Returns None`"""defget(self)->str:"""Get label value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set label value. `Returns None`"""LabeledValue^A pair of ActiveLabels in a frame acting as a label and value pair with the label in boldclassLabeledValue(Frame):def__init__(self,parent:tkinter.ttk.Frame,label_text:str=None,value_text:str=None,label_config:dict={},value_config:dict={},*args,**kwargs):...defdestroy(self):"""Destroy this and all descendants widgets."""defget(self)->str:"""Returns the label's and value's texts separated by a space. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:tuple):"""Set the label and value from two text strings in a tuple like ("label:", "value"). `Returns None`"""Labeler Widget^ActiveButton^ttk.Button with added featuresclassActiveButton(Button,SuperWidgetMixin):def__init__(self,parent,default:str='',command:Callable=None,widgetargs:dict={},**kw):...defclear(self)->None:"""Set button text to default"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable button"""defenable(self)->None:"""Enable button"""defget(self)->str:"""Get button text"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set button text"""LabeledButton^Labeled ActiveButton widgetclassLabeledButton(Labeler,ActiveButton):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,command:Callable='',default:str='',is_child:bool=False,labelside:str='left',**kw):...defclear(self)->None:"""Set button text to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable button"""defenable(self)->None:"""Enable button"""defget(self)->str:"""Get button text"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set button text"""LabeledMultiButton^Labeled MultiWidget LabeledButton.Used when you need multiple, vertically stacked Labeled ActiveButtonsclassLabeledMultiButton(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""CycleButton^ActiveButton that cycles through options on each clickclassCycleButton(ActiveButton):def__init__(self,parent:tkinter.ttk.Frame,options:list,default:int=0,command:Callable=None,**kw):...defclear(self,event=None):...defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable button"""defenable(self)->None:"""Enable button"""defget(self)->str:"""Get button text"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set button text"""LabeledCycleButton^Labeled CycleButton widgetclassLabeledCycleButton(Labeler,CycleButton):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,options:list,is_child:bool=False,labelside:str='left',**kw):...defclear(self,event=None):...defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable button"""defenable(self)->None:"""Enable button"""defget(self)->str:"""Get button text"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set button text"""LabeledMultiCycleButton^Labeled MultiWidget LabeledCycleButtonUsed when you need multiple, vertically stacked Labeled CycleButtonsclassLabeledMultiCycleButton(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""ListBox Widgets^ScrolledListBox^Scrolled Listbox with SuperWidget mixinclassScrolledListBox(Scroller,Listbox,SuperWidgetMixin):def__init__(self,parent,**kw)->object:...defactivate(self,index):"""Activate item identified by INDEX."""defadd(self,val:str)->None:"""Add an item to the end of the Listbox. `Returns None`"""defadd_list(self,items:list)->None:"""Add a list of items to the end of the Listbox. `Returns None`"""defclear(self)->None:"""Clear Listbox. `Returns None`"""defcurselection(self):"""Return the indices of currently selected item."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self):"""Disable Listbox. `Returns None`"""defenable(self):"""Disable Listbox. `Returns None`"""defget(self,first,last=None):"""Get list of items from FIRST to LAST (included)."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""OrderedListbox^A Scrolled Re-Orderable Listbox with SuperWidget mixinUsed when you need a re-orderable listbox for list arrangement etc. "selectmode" can only be "single" for this Widget.classOrderedListbox(ScrolledListBox):def__init__(self,parent:tkinter.ttk.Frame,**kw):...defactivate(self,index):"""Activate item identified by INDEX."""defadd(self,val:str)->None:"""Add an item to the end of the Listbox. `Returns None`"""defadd_list(self,items:list)->None:"""Add a list of items to the end of the Listbox. `Returns None`"""defclear(self)->None:"""Clear Listbox. `Returns None`"""defcurselection(self):"""Return the indices of currently selected item."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self):"""Disable Listbox. `Returns None`"""defenable(self):"""Disable Listbox. `Returns None`"""defget(self,first,last=None):"""Get list of items from FIRST to LAST (included)."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""ListManipulator^classListManipulator(Frame):def__init__(self,parent:tkinter.ttk.Frame,disable_entry:bool=False,load_button_text:str='Load',load_button_width:int=6,clear_button_text='Clear',clear_button_width:int=6,add_button_text:str='Add>',add_button_width:int=6,listbox_height:int=7,entry_text:str='Add item',**kwargs):...defadd(self,val:str)->None:"""Add an item to the listbox. `Returns None`"""defadd_list(self,*args)->None:"""Add a list to the listbox. `Returns None`"""defclear(self)->None:"""Clear Entry and Listbox. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Listbox, Entry, and Buttons. `Returns None`"""defenable(self)->None:"""Enable Listbox, Entry, and Buttons. `Returns None`"""defget(self)->list:"""Get the list of items in the listbox. `Returns a list`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defload(self)->None:"""Load file, clear Listbox, insert each line from file into listbox. `Returns None`"""Table^Listboxes bound to scroll in union. Additional bindings will be needed in order to handle clicking.Tested on Mac/Windows/Linux. In most cases a TreeTable widget will be superior to this.classTable(Frame):def__init__(self,*args,min_column_width:int=100,start_column_width:int=100,on_selection:Callable=None,visible_rows=0,**kw):...defbuild(self,contents:dict)->None:"""Rebuild the table"""defclear(self)->None:"""Clears the table"""defdestroy(self):"""Destroy this and all descendants widgets."""defget(self)->list:"""Gets the currently selected items from the table. `Returns a List of Strings`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defuse_style(self,style:tkinter.ttk.Style)->None:"""Update to match supplied ttk.Style object. `Returns None`"""OptionMenu Widgets^ActiveOptionMenu^ttk.OptionMenu with added features and SuperWidgetMixinclassActiveOptionMenu(OptionMenu,SuperWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,options:list,default:int=0,on_keystroke:bool=False,bind_enter:bool=True,bind_escape_clear:bool=True,command:Callable=None,widgetargs:dict={}):...defclear(self)->None:"""Sets OptionMenu to its default value. `Returns None`"""defdestroy(self):"""Destroy this widget and its associated variable."""defdisable(self)->None:"""Disable OptionMenu. `Returns None`"""defenable(self)->None:"""Enable OptionMenu. `Returns None`"""defget(self)->str:"""Get OptionMenu value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set OptionMenu value. `Returns None`"""defset_menu(self,default=None,*values):"""Build a new menu of radiobuttons with *values and optionally a default value."""LabeledOptionMenu^Labeled ActiveOptionMenuclassLabeledOptionMenu(Labeler,ActiveOptionMenu):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,*args,is_child:bool=False,**kw):...defclear(self)->None:"""Sets OptionMenu to its default value. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this widget and its associated variable."""defdisable(self)->None:"""Disable OptionMenu. `Returns None`"""defenable(self)->None:"""Enable OptionMenu. `Returns None`"""defget(self)->str:"""Get OptionMenu value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val)->None:"""Set OptionMenu value. `Returns None`"""defset_menu(self,default=None,*values):"""Build a new menu of radiobuttons with *values and optionally a default value."""LabeledMultiOptionMenu^Labeled MultiWidget LabeledOptionMenuclassLabeledMultiOptionMenu(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""ProgressBar Widgets^ActiveProgressbar^ttk.Progressbar with added featuresclassActiveProgressbar(Progressbar):def__init__(self,parent:tkinter.ttk.Frame,default:float=0,**kw):...defclear(self):"""Sets Progressbar progress to its default value `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self):"""Enable Progressbar. `Returns None`"""defenable(self):"""Disable Progressbar. `Returns None`"""defget(self):"""Set Progressbar progress. `Returns None`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""deflink(self,widget):"""Easily link to other widgets, sets the progressbar var to the passed widget's var. `Returns None`"""defset(self,val):"""Get Progressbar progress. `Returns a String`"""defstart(self,interval=None):"""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."""defstep(self,amount=None):"""Increments the value option by amount. amount defaults to 1.0 if omitted."""defstop(self):"""Stop autoincrement mode: cancels any recurring timer event initiated by start."""LabeledProgressbar^Labeled ProgressbarclassLabeledProgressbar(Labeler,ActiveProgressbar):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,orient='horizontal',labelside='left',is_child=False,default:float=0,**kw):...defclear(self):"""Sets Progressbar progress to its default value `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self):"""Enable Progressbar. `Returns None`"""defenable(self):"""Disable Progressbar. `Returns None`"""defget(self):"""Set Progressbar progress. `Returns None`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""deflink(self,widget):"""Easily link to other widgets, sets the progressbar var to the passed widget's var. `Returns None`"""defset(self,val):"""Get Progressbar progress. `Returns a String`"""defstart(self,interval=None):"""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."""defstep(self,amount=None):"""Increments the value option by amount. amount defaults to 1.0 if omitted."""defstop(self):"""Stop autoincrement mode: cancels any recurring timer event initiated by start."""LabeledMultiProgressbar^Labeled MultiWidget LabeledProgressbarclassLabeledMultiProgressbar(Labeler,Frame,MultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside='top',orient='horizontal'):...defadd(self,parent:tkinter.ttk.Frame,key:str,args,kwargs,widget_type=None)->object:"""Overrides normal MultiWidgetMixin behavior to deal with vertical orientation. Will break most added widgets `Returns None`"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""deflink(self,config:dict)->None:"""Link to other widgets with a dict of subwidget keys to link to. This function will break if widgets without the link method are added to the MultiWidget. `Returns None`"""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""Radiobutton Widgets^ActiveRadiobutton^ttk.Radiobutton with added features and the SuperWidgetMixinclassActiveRadiobutton(Radiobutton,SuperWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,text:str,value:str,variable:tkinter.StringVar|tkinter.IntVar|tkinter.DoubleVar,widgetargs:dict={},**kw):...defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:...defenable(self)->None:...defget(self)->bool:"""`Returns a bool if the button is clicked`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str|int|float)->None:"""Set value, input type varies base on tk variable type. `Returns None`"""RadioTable^A table of ttk.RadioButtonsclassRadioTable(Frame):def__init__(self,parent:tkinter.ttk.Frame,options:tuple,default:int=0,variable_type:type=<class'tkinter.StringVar'>, state: str = 'normal', columns: int = 1, pack_args: dict ={}, **kw):...defclear(self)->None:"""Sets Radiobutton to its default value. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Enable Radiobutton. `Returns None`"""defenable(self)->None:"""Disable Radiobutton. `Returns None`"""defget(self)->str:"""Get Radiobutton value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set Radiobutton value. `Returns None`"""LabeledRadioTable^Labeled RadioTable widgetclassLabeledRadioTable(Labeler,RadioTable):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,is_child:bool=False,labelside:str='top',**kw):...defclear(self)->None:"""Sets Radiobutton to its default value. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Enable Radiobutton. `Returns None`"""defenable(self)->None:"""Disable Radiobutton. `Returns None`"""defget(self)->str:"""Get Radiobutton value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set Radiobutton value. `Returns None`"""LabeledMultiRadioTable^Labeled MultiWidget LabeledRadioTableUsed when you need multiple, vertically stacked LabeledRadioTablesclassLabeledMultiRadioTable(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""SimpleRadioTable^A simplified RadioTable where the text is used at the value.Uses a tk.StringVar variable type only. Takes a tuple in the form(value1, value2, ...)classSimpleRadioTable(RadioTable):def__init__(self,parent:tkinter.ttk.Frame,options:tuple,**kw):...defclear(self)->None:"""Sets Radiobutton to its default value. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Enable Radiobutton. `Returns None`"""defenable(self)->None:"""Disable Radiobutton. `Returns None`"""defget(self)->str:"""Get Radiobutton value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set Radiobutton value. `Returns None`"""LabeledSimpleRadioTable^Labeled SimpleRadioTable widgetclassLabeledSimpleRadioTable(Labeler,SimpleRadioTable):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,options:list,is_child:bool=False,labelside:str='top',**kw):...defclear(self)->None:"""Sets Radiobutton to its default value. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Enable Radiobutton. `Returns None`"""defenable(self)->None:"""Disable Radiobutton. `Returns None`"""defget(self)->str:"""Get Radiobutton value. `Returns a String`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set Radiobutton value. `Returns None`"""LabeledMultiSimpleRadioTable^Labeled MultiWidget LabeledSimpleRadioTableUsed when you need multiple, vertically stacked LabeledSimpleRadioTablesclassLabeledMultiSimpleRadioTable(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""Scale Widgets^ActiveScale^ttk.Scale with added features and the SuperWidget mixinclassActiveScale(Scale,SuperWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,command:Callable=None,default:float=0,widgetargs:dict={},**kw):...defclear(self)->None:"""Sets Scale to its default value. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Enable Scale. `Returns None`"""defenable(self)->None:"""Disable Scale. `Returns None`"""defget(self)->float:"""Get Scale value. `Returns a Float`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:float)->None:"""Set Scale value. `Returns None`"""LabeledScale^Labeled ActiveScaleclassLabeledScale(Labeler,ActiveScale):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,command:Callable=None,orient:bool='horizontal',is_child:bool=False,labelside:str='left',**kw):...defclear(self)->None:"""Sets Scale to its default value. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Enable Scale. `Returns None`"""defenable(self)->None:"""Disable Scale. `Returns None`"""defget(self)->float:"""Get Scale value. `Returns a Float`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:float)->None:"""Set Scale value. `Returns None`"""LabeledMultiScale^Labeled MultiWidget Labeled ScaleclassLabeledMultiScale(Labeler,Frame,MultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside='top',orient='horizontal',command=None):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list,kwargs:dict,widget_type:type=None)->object:"""Override MultiWidgetMixin for vertical orientation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""Spinbox Widgets^ActiveSpinbox^Spinbox with added featuresclassActiveSpinbox(Spinbox,SuperWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,command:Callable=None,default:int=0,on_keystroke:bool=False,bind_enter:bool=True,bind_escape_clear:bool=True,bind_mouse_wheel:bool=True,custom_values:bool=True,widgetargs:dict={},**kw):...defclear(self)->None:"""Sets Spinbox to its default value. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Spinbox. `Returns None`"""defenable(self)->None:"""Enable Spinbox. `Returns None`"""defget(self)->int:"""Get Spinbox value. `Returns an Int`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:int)->None:"""Set Spinbox value. `Returns None`"""LabeledSpinbox^Labeled Spinbox with the SuperWidget mixinclassLabeledSpinbox(Labeler,ActiveSpinbox):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,labelside:str='left',is_child:bool=False,**kw):...defclear(self)->None:"""Sets Spinbox to its default value. `Returns None`"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable Spinbox. `Returns None`"""defenable(self)->None:"""Enable Spinbox. `Returns None`"""defget(self)->int:"""Get Spinbox value. `Returns an Int`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:int)->None:"""Set Spinbox value. `Returns None`"""LabeledMultiSpinbox^Labeled MultiWidget Spinbox.Used when you need multiple, vertically stacked Labeled SpinboxesclassLabeledMultiSpinbox(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""Text Widgets^ScrolledText^Scrolled Text with SuperWidget mixinScrolled Text SuperWidgetclassScrolledText(Scroller,Text,SuperWidgetMixin):def__init__(self,parent,**kw)->object:...defclear(self)->None:"""Empties the text box. `Returns None`"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:...defedit_undo(self):"""Undoes the last edit action If the undo option is true. An edit action is defined as all the insert and delete commands that are recorded on the undo stack in between two separators. Generates an error when the undo stack is empty. Does nothing when the undo option is false"""defenable(self)->None:"""Enable Text box"""defget(self,start:str='1.0',end:str='end'):"""Returns the contents of the text box with optional start/end kwargs. `Returns a String`"""defget_cursor(self):"""Get the current location of the cursor. `Returns None`"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defselect_all(self,event=None)->None:"""Selects all text. `Returns None`"""defset(self,val:str)->None:"""Sets the text. `Returns a String`"""defwindow_create(self,index,cnf={},**kw):"""Create a window at INDEX."""CopyBox^Scrolled Text with "Copy to Clipboard" ButtonA widget with a scrolled textbox and button that copies the textbox contents to the user's clipboard. Useful for form output, etc.classCopyBox(Frame):def__init__(self,parent:tkinter.ttk.Frame,**kw):...defclear(self)->None:"""Clear CopyBox Contents"""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable CopyBox"""defenable(self)->None:"""Enable CopyBox"""defget(self)->None:"""Get CopyBox contents"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set CopyBox Contents"""LabeledCopyBox^Labeled CopyBox widgetclassLabeledCopyBox(Labeler,CopyBox):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,is_child:bool=False,labelside:str='left',**kw):...defclear(self)->None:"""Clear CopyBox Contents"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self)->None:"""Disable CopyBox"""defenable(self)->None:"""Enable CopyBox"""defget(self)->None:"""Get CopyBox contents"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,val:str)->None:"""Set CopyBox Contents"""LabeledMultiCopyBox^Labeled MultiWidget CopyBox.Used when you need multiple, vertically stacked Labeled CopyBoxesclassLabeledMultiCopyBox(LabeledMultiWidgetMixin):def__init__(self,parent:tkinter.ttk.Frame,labeltext:str,config:dict,is_child:bool=False,labelside:str='top',**kw):...defadd(self,parent:tkinter.ttk.Frame,key:str,args:list=[],kwargs:dict={},widget_type:type=None,fill:str='x',padx:tuple=(20,0),pady:tuple=(5,0),side:str='top',expand:bool=False)->object:"""Method for adding different widgets to a multiwidget post-instantiation"""defclear(self,config:list=None)->None:"""Pass a list of subwidgets to clear or all are set to default"""defclear_label_text(self)->None:"""Clear a Labeled widget's Label text."""defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self,config:list=None)->None:"""Pass a list of subwidgets to disable or all are disabled"""defenable(self,config:list=None)->None:"""Pass a list of subwidgets to enable or all are enabled"""defget(self,config:list=None)->dict:"""Pass a list of widget keys to get a dict of outputs"""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset(self,config:dict)->None:"""Pass a map of widget keys and their values"""Toplevel Widgets^FocusedToplevel^Base Focused Toplevel ClassWindow that takes focus and center's itself on the current window. Used as a base class for other windows.classFocusedToplevel(Toplevel):def__init__(self,*args,title:str=None,window:tkinter.Toplevel=None,on_close:Callable=None,**kwargs):...defdestroy(self)->None:...deficonify(self):"""Display widget as icon."""deficonmask(self,bitmap=None):"""Set mask for the icon bitmap of this widget. Return the mask if None is given."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""NoticeWindow^Provides the user with a notice.button_actioncan call a function to help with determining acceptance vs. the user hitting the exit button.classNoticeWindow(FocusedToplevel):def__init__(self,*args,text:str=None,button_text:str='Continue',button_action:Callable=None,**kwargs):...defdestroy(self)->None:...deficonify(self):"""Display widget as icon."""deficonmask(self,bitmap=None):"""Set mask for the icon bitmap of this widget. Return the mask if None is given."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""YesNoCancelWindow^Provides the user with a yes/no/cancel option.no_destroycan be set toTrueto allow the window to remain open after a selection is made.classYesNoCancelWindow(FocusedToplevel):def__init__(self,*args,text:str=None,yes_enabled:bool=True,on_yes:Callable=None,yes_text:str='Yes',no_enabled:bool=True,on_no:Callable=None,no_text:str='No',cancel_enabled:bool=True,on_cancel:Callable=None,cancel_text:str='Cancel',no_destroy:bool=False,focus:str='',**kwargs):...defdestroy(self)->None:...deficonify(self):"""Display widget as icon."""deficonmask(self,bitmap=None):"""Set mask for the icon bitmap of this widget. Return the mask if None is given."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""PromptWindow^Prompts the user for a text inputno_destroycan be set toTrueto allow the window to remain open after a selection is made, useful for informing the user a string input was invalid via setting label_var. If the select_type kwarg is set to true the user will be prompted to select a data type (int / string) to return.classPromptWindow(FocusedToplevel):def__init__(self,*args,text:str='Enter Text:',on_yes=None,yes_text:str='Continue',on_cancel=None,cancel_text:str='Cancel',bind_enter:bool=True,no_destroy:bool=False,select_type:bool=False,focus='',**kwargs):...defdestroy(self)->None:...deficonify(self):"""Display widget as icon."""deficonmask(self,bitmap=None):"""Set mask for the icon bitmap of this widget. Return the mask if None is given."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""PasswordWindow^Password Entry window.Demo Password Entry Window, you will want to copy the source for this widget and rewrite it.classPasswordWindow(FocusedToplevel):def__init__(self,window=None,**kwargs):...defdestroy(self)->None:...deficonify(self):"""Display widget as icon."""deficonmask(self,bitmap=None):"""Set mask for the icon bitmap of this widget. Return the mask if None is given."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""ListWindow^Window to select an option from a Scrolled ListboxclassListWindow(FocusedToplevel):def__init__(self,*args,options:list,text:str='Select Item:',on_yes=None,yes_text:str='Continue',on_cancel=None,cancel_text:str='Cancel',no_destroy:bool=False,select_mode:str='single',**kwargs):...defdestroy(self)->None:...deficonify(self):"""Display widget as icon."""deficonmask(self,bitmap=None):"""Set mask for the icon bitmap of this widget. Return the mask if None is given."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""TextWindow^Provides the user a cancelable Scrolled Text windowno_destroycan be set toTrueto allow the window to remain open after a submission is made. on_yes callback must take the text value as a String.classTextWindow(FocusedToplevel):def__init__(self,*args,text:str='Enter Text',on_yes:Callable=None,yes_text:str='Submit',on_cancel:Callable=None,cancel_text:str='Cancel',no_destroy:bool=False,focus:str='',default:str='',height:int=32,width:int=88,**kwargs):...defdestroy(self)->None:...deficonify(self):"""Display widget as icon."""deficonmask(self,bitmap=None):"""Set mask for the icon bitmap of this widget. Return the mask if None is given."""definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""Misc Widgets^ToolTip^Easy ToolTipEasily show theme-friendly tooltip. Currently only left and right align are supported.classToolTip(ToolTipBase):def__init__(self,parent:object,text:str,align:str='left'):...EasySizegrip^Sizegrip widget with bindingsAutomatically packs self and binds mouse presses for systems that don't bind automatically.classEasySizegrip(Sizegrip):def__init__(self,*args,**kwargs):...defdestroy(self):"""Destroy this and all descendants widgets."""defdisable(self):...defenable(self):...definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""SuperLib.utils^Utils^check_if_module_installed^Indicates if a packages is installed.Returns a Booleandefcheck_if_module_installed(package:str)->bool:>...check_string_contains^Returns(True, char_index)if any character from the list exists in the string otherwise returns(False, None)defcheck_string_contains(string:str,contains_list:tuple)->tuple:>...dummy_function^Dummy function that nicely prints out any passed args and kwargs.Returns Truedefdummy_function(*args,**kwargs)->bool:>...get_friendly_time^Gets a time string in one of several modes. Modes:all, time, date, nice_date.Returns a Stringdefget_friendly_time(timestamp,mode:str='all')->str:>...get_unix_timestamp^Get a unix timestamp.Returns a Floatdefget_unix_timestamp()->float:>...get_unix_timestring^Get a unix timestring.Returns a Stringdefget_unix_timestring()->str:>...get_user_home_folder^Cross-platform function to get a user's home folderdefget_user_home_folder()->str:>...open_folder_in_explorer^Cross-platform way to open a folder in the default file manager for a systemdefopen_folder_in_explorer(path)->None:>...sort_dict_by_keys^Sorts a dictionary by its keysdefsort_dict_by_keys(source:dict,reverse:bool=False)->collections.OrderedDict:>...timer_decorator^Decorator to add timing to a functiondeftimer_decorator(func:Callable)->None:>...File Generators^HTML_Generator^classHTML_Generator(object):def__init__(self,indent='\t'):...defadd_body_line(self,text=''):...defadd_bold(self,text=''):...defadd_center(self,text=''):...defadd_comment(self,text):...defadd_div(self,text=''):...defadd_divider(self):...defadd_list(self,items=[],ordered=False):...defadd_list_item(self,item:str):...defadd_paragraph(self,text=''):...defassemble(self):...defend_bold(self):...defend_center(self):...defend_div(self):...defend_list(self,ordered=False):...defend_paragraph(self):...defget_indent(self,offset=0):...defsave(self,path):...defstart_bold(self,text=''):...defstart_center(self,text=''):...defstart_div(self,text=''):...defstart_list(self,items=[],ordered=False):...defstart_paragraph(self,text=''):...TXT_Generator^classTXT_Generator(object):def__init__(self,):...defadd_body_line(self,text=''):...defadd_divider(self):...defassemble(self):...defsave(self,path):...MD_Generator^classMD_Generator(object):def__init__(self,title=None,footnote_title='Notes:',footnote_heading_level=2,numbered_toc=False):...defadd_blockquote(self,text,end='\n\n'):...defadd_bold(self,text,end='\n\n'):...defadd_bold_italic(self,text,end='\n'):...defadd_break(self):...defadd_code_block(self,text,lang='',end='\n'):...defadd_heading_1(self,text,**kwargs):...defadd_heading_2(self,text,**kwargs):...defadd_heading_3(self,text,**kwargs):...defadd_heading_4(self,text,**kwargs):...defadd_heading_5(self,text,**kwargs):...defadd_heading_6(self,text,**kwargs):...defadd_horizontal_rule(self):...defadd_italic(self,text,end='\n'):...defadd_link(self,link,text=None,tooltip=None):...defadd_multi_blockquote(self,texts):...defadd_ordered_list(self,texts,indent=0):...defadd_paragraph(self,text,end='\n\n'):...defadd_to_ordered_list(self,index,text,indent=0):...defadd_to_unordered_list(self,text,indent=0):...defadd_toc(self,title,end='\n\n'):...defadd_unordered_list(self,texts,indent=0):...defassemble(self):...defdecrease_toc_depth(self):...defget_prefix(self):...defincrease_toc_depth(self):...definsert_footnote(self,text):...defsave(self,path):...defset_slogan(self,slogan):...History Mixin^HistoryMixin^Abstract mixin to add history-tracking to an applicationThis object is meant to be used as a mixin rather than instantiated directly most of the time.classHistoryMixin(object):def__init__(self,data):...defadd_history(self,data):...defclear_history(self,data):...defget_history_uid(self):...defredo(self):...defundo(self):...Color Functions^reduce_255^Limits a val to a range of 0 to 255defreduce_255(in_value:int,maxval:int=255)->int:>...rgb_to_hex^Converts an rgb tuple to hexdefrgb_to_hex(rgb:tuple)->str:>...rgba_to_hex^Converts an rgba tuple to rgba hexdefrgba_to_hex(rgba:tuple)->str:>...hex_to_rgb^Converts hex to rgb tupledefhex_to_rgb(hex:str)->tuple:>...hex_to_rgba^Tries to convert rgba hex to rgba, on failure converts rgb hex to rgb and sets a full opacitydefhex_to_rgba(hex:str)->tuple:>...get_gradient^Generates a black / white gradient with a given number of stepsdefget_gradient(steps:int)->tuple:>...rgb_to_scalar^Converts an rgb itterable to scalar listdefrgb_to_scalar(rgb:tuple)->tuple:>...scalar_to_rgb^Converts rgb scalar to rgb listdefscalar_to_rgb(rgb:tuple)->tuple:>...linear_gradient^Generates a linear gradient between two colors, accepts html hex or rgb formatsdeflinear_gradient(start_hex:str='#000000',finish_hex:str='#FFFFFF',n:int=10)->list:>...get_rainbow^Generates a rainbow with a given number of steps. Steps must be divisible by 4)defget_rainbow(steps:int)->tuple:>...MegaWidgets^Notes MegaWidget^NotesTab^classNotesTab(Tab):def__init__(self,notebook,app):...defcopy_note(self,note):...defdelete_note(self,note):...defdestroy(self):"""Destroy this and all descendants widgets."""defexport_note_html(self,note):...defexport_note_json(self,note):...defexport_note_markdown(self,note):...defexport_note_text(self,note):...definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defload_notes(self):...defmake_new_note(self,title):...defnew_note(self,event=None):...defon_toplevel_destroy(self,*args):"""Function for toplevels to call on no / cancel"""defreload_notes(self):...defrename_note(self,note):...defstart_new_note(self,title=None):...Conversation MegaWidget^ConversationsTab^classConversationsTab(Tab):def__init__(self,notebook,app):...defcopy_conversation(self,conversation):...defdelete_conversation(self,conversation):...defdestroy(self):"""Destroy this and all descendants widgets."""defexport_conversation_html(self,conversation):...defexport_conversation_json(self,conversation):...defexport_conversation_markdown(self,conversation):...defexport_conversation_text(self,conversation):...defget_cached_icon(self,size,color,char):...defget_user_icon(self,user):...definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defload_conversations(self):...defmake_new_conversation(self,title):...defnew_conversation(self,event=None):...defon_toplevel_destroy(self,*args):"""Function for toplevels to call on no / cancel"""defreload_conversations(self):...defrename_conversation(self,conversation):...defstart_new_conversation(self,title=None):...Profile Management^ProfilesSystem^classProfilesSystem(object):def__init__(self,select_profile_actions:list=[],refresh_profiles_actions:list=[],profiles_dir:str='C:\\Users\\arcti\\GitHub\\py_simple_ttk\\Profiles',handle_duplicates:bool=True):...defadd_refresh_profiles_action(self,action:Callable)->None:"""Add an action to the profiles list refresh actions"""defadd_refresh_profiles_actions(self,actions:list)->None:"""Add a list of actions to the profiles list refresh actions"""defadd_select_profile_action(self,action:Callable)->None:"""Add an action to the profile switch actions"""defadd_select_profile_actions(self,actions:list)->None:"""Add a list of actions to the profile switch actions"""defcheck_if_name_exists_in_profiles(self,name:str,profiles:list=None)->bool:"""Check if a name exists in a list of profiles, if no list is provided uses the list of all profiles. `Returns a Bool`"""defclear_refresh_profile_actions(self,new:list=[])->None:"""Clear out the profiles list refresh actions, optionally replacing them with new ones"""defclear_select_profile_actions(self,new:list=[])->None:"""Clear out the profile switch actions, optionally replacing them with new ones"""defcreate_profile(self,name:str)->src.py_simple_ttk.utils.ProfilesSystem.UserProfile:"""Creates a profile with a given name. `Raises ValueError` if the profile name already exists. `Returns a UserProfile`"""defdelete_profile(self,profile:src.py_simple_ttk.utils.ProfilesSystem.UserProfile)->None:...defget_last_used_profile(self,profiles:list=None)->src.py_simple_ttk.utils.ProfilesSystem.UserProfile:"""Returns the most recently accessed profile"""defget_profile_by_username(self,name:str)->src.py_simple_ttk.utils.ProfilesSystem.UserProfile:...defget_profile_names(self)->list:"""Returns an alphabetically sorted list of profile names"""defhandle_duplicate_profile_names(self,name:str)->None:"""Makes profile names unique if they have identical names. The most recently accessed profile (according to the file json) keeps its name untouched. `Returns None`"""defhandle_refresh_profiles_actions(self)->None:"""Handle on-refresh-profiles actions"""defhandle_select_profile_actions(self)->None:"""Handle on-profile-selection actions"""defselect_profile(self,profile:src.py_simple_ttk.utils.ProfilesSystem.UserProfile)->None:"""Change the currently selected profile"""defselect_profile_by_username(self,name:str)->None:...defsort_profiles_by_accessed(self,profiles:list=None)->None:"""Sort a list of profiles by last accessed, if no list is provided returns a sorted list of all profiles in the system. `Returns a List`"""UserProfile^A class to represent a User / User's PreferencesMust pass a unique username and a unique identifier for new profile.classUserProfile(object):def__init__(self,path:str,username:str=None,atomic:str=None):...defclear_preferences(self,preferences:list=None)->None:...defget_preference(self,key:str)->object:...defload(self,path:str=None,overwrite_path:bool=False)->None:...defsave(self,path:str=None,overwrite_path:bool=False)->None:...defset_preference(self,key:str,value:str)->None:...defset_username(self,name:str)->None:...get_profiles_folder^Gets the absolute path to the included profiles folder.Returns a Stringdefget_profiles_folder()->str:>...get_profiles_list^Gets a list of profile files at a given path.Returns a List of Path stringsdefget_profiles_list(path:str='./Profiles',verbose:bool=False)->list:>...PIL-Only Widgets and Functions^py_simple_ttk has a number of widgets and functions only available when PIL is installed. By default, installing py_simple_ttk through pip doesNOTinstall PIL. py_simple_ttk provides a method to check if PIL is available at runtime:from py_simple_ttk import PILLOW_AVAILABLETo enable PIL-only widgets runpip install PIL, when creating your own modules that use py_simple_ttk as a dependency ensure you add PIL to your project's requirements.txt / pyproject.toml filePIL-Only Widgets^GifLoader^classGifLoader(object):def__init__(self,path:str,defer_load:bool=False):...defload_tk_frames(self)->None:"""Called during instantiation unless defer_load was set to False"""GifViewer^classGifViewer(Frame):def__init__(self,loader:src.py_simple_ttk.pillow_widgets.GifLoader.GifLoader,*args,**kwargs):...defdestroy(self):"""Destroy this and all descendants widgets."""defdisplay_loop(self)->None:...definfo_patchlevel(self):"""Returns the exact version of the Tcl library."""defset_delay(self,fps)->None:...PIL-Only Functions^convert_image_to_blackandwhite^Converts an image to black and whitedefconvert_image_to_blackandwhite(image:PIL.Image.Image)->PIL.Image.Image:>...convert_image_to_grayscale^Converts a PIL image to grayscaledefconvert_image_to_grayscale(image:PIL.Image.Image)->PIL.Image.Image:>...load_image_from_byte_array^Converts a png encoded in bytes to a PIL Imagedefload_image_from_byte_array(byte_array:bytes)->PIL.Image.Image:>...load_tk_image_from_bytes_array^Loads a png encoded in bytes to an image tkinter can processdefload_tk_image_from_bytes_array(bytes_array:bytes)->PIL.ImageTk.PhotoImage:>...make_checkerboard^Function to make a background checkerboard for displaying images ondefmake_checkerboard(width:int,height:int,repeat:int=14,color_1:tuple=(127,127,127,255),color_2:tuple=(64,64,64,255))->PIL.Image.Image:>...Changelog^0.2.9^Add more scroller imports to toplevel namespace0.2.8^Add get_scaling and bind_mousewheel to toplevel namespace import. Fix theme defaulting to winnative to fix unix system crash when theme not configured in ini.json0.2.7^Fix missing ImageDraw import in ImageCore.py0.2.6^Add more functions to pillow_widgets/ImageCore.py and cleaned up typehinting, added pillow widgets to readme0.2.5^Add utils/tcl_commands.py with tcl_bell, tcl_center_window, and tcl_choose_font functions0.2.4^Use recursive import on asset folders to fix ALL missing assets.0.2.3^Fix missing theme and font assets0.2.2^Fix readme, remove pkg_resources in favor of importlib0.2.1^Fix pkg_resources dependency0.2.0^Restructure for better pep compliance, breaks some imports.0.1.42^Add <> custom event to ScrolledText0.1.41^Add enable / disable to ActiveButton0.1.40^Fix bug with TextWindow0.1.39^Add TextWindow to ToplevelWidgets.py0.1.38^Add 16px python icons to assets0.1.37^Multi-Widgets packing can be customized through multiwidget.add() kwargs0.1.36^More improvements to the font system, added font tab to test.py0.1.35^Added more label styles0.1.34^Add init option to disable default notebook. Add function to make config file from dict (for testing, parent applications launching apps with custom args, etc.). Add handling when no ini width / height specified. Added ListManipulator widget.0.1.33^Fix labeled checkbutton packing0.1.32^Cleanup0.1.31^Add ActiveLabel and LabeledValue, add image_encoder.py and list_compare.py to demos0.1.30^Cleanup, bug fixes, add HamburgerFrame0.1.29^Move TicTacToe to examples0.1.28^Move SuperWidgetMixin from WidgetsCore.py to SuperWidget.py0.1.27^Add ActiveButton, ActiveCheckButton, ActiveComboBox, ActiveEntry, ActiveOptionMenu, ActiveProgressbar, ActiveRadioButton, ActiveScale, ColumnFrame, CycleButton, LabeledButton, LabeledMultiButton, LabeledCycleButton, LabeledMultiCycleButton, LabeledMultiRadioTable, LabeledMultiSimpleRadioTable, LabeledRadioTable, LabeledSimpleRadioTable, RadioTable, SimpleRadioTable, Remove: LabeledRadioButton, LabeledMultiRadioButton0.1.26^Add Spinbox widgets, fix Copybox0.1.25^Reduce packaged fonts color pallete0.1.24^Update readme generator with more config keys, fix ini readme md code block being marked as python0.1.23^Add columns to Configurable Launcher0.1.22^Fix readme0.1.21^Fix readme0.1.20^Add counter widget.0.1.19^Add dynamic launcher system.0.1.18^Add Ordered Listbox, add more bindings to SuperWidget, cleanup0.1.17^Add set_desktop_background to WidgetsCore.py0.1.16^Add needs_white_text to color.py, add pyinstaller compatibility to WidgetsCore.get_asset0.1.15^Fix misnamed function in color.py0.1.14^Fix missing import in app.py0.1.13^reduced variety of packaged font images, fixed bug with constrained widgets command not triggering0.1.12^Add Constrained + Labeled + Multi Entries (>35 widgets)0.1.11^Fix LabeledPathEntry error when no dialog type was specified0.1.10^Add LabeledPathEntry to EntryWidgets.py0.1.9^Add pencil icons to assets0.1.8^Fix labeled button not running command on press0.1.7^add labeled button0.1.6^Fix missing Labeler import0.1.5^Fix broken package0.1.4^Fix broken package0.1.3^More cleanup, input fixes.py0.1.2^Cleanup, move type lists to generate_readme.py0.1.1^Fix missing 'ListWindow' import in app.py0.1.0^ModulizeGenerated withpy_simple_readme