neulab/docprompting-conala huggingface dataset:
tkinter.scrolledtext — Scrolled Text Widget Source code: Lib/tkinter/scrolledtext.py The tkinter.scrolledtext module provides a class of the same name which implements a basic text widget which has a vertical scroll bar configured to do the “right thing.” Using the ScrolledText class is a lot easier than setting up a text widget and scroll bar directly. The text widget and scrollbar are packed together in a Frame, and the methods of the Grid and Pack geometry managers are acquired from the Frame object. This allows the ScrolledText widget to be used directly to achieve most normal geometry management behavior. Should more specific control be necessary, the following attributes are available:  
class tkinter.scrolledtext.ScrolledText(master=None, **kw)  
 
frame  
The frame which surrounds the text and scroll bar widgets. 
  
vbar  
The scroll bar widget.
class tkinter.scrolledtext.ScrolledText(master=None, **kw)  
 
frame  
The frame which surrounds the text and scroll bar widgets. 
  
vbar  
The scroll bar widget.
tkinter.simpledialog.askfloat(title, prompt, **kw)  
tkinter.simpledialog.askinteger(title, prompt, **kw)  
tkinter.simpledialog.askstring(title, prompt, **kw)  
The above three functions provide dialogs that prompt the user to enter a value of the desired type.
class tkinter.simpledialog.Dialog(parent, title=None)  
The base class for custom dialogs.  
body(master)  
Override to construct the dialog’s interface and return the widget that should have initial focus. 
  
buttonbox()  
Default behaviour adds OK and Cancel buttons. Override for custom button layouts.
body(master)  
Override to construct the dialog’s interface and return the widget that should have initial focus.
tkinter.Tcl(screenName=None, baseName=None, className='Tk', useTk=0)  
The Tcl() function is a factory function which creates an object much like that created by the Tk class, except that it does not initialize the Tk subsystem. This is most often useful when driving the Tcl interpreter in an environment where one doesn’t want to create extraneous toplevel windows, or where one cannot (such as Unix/Linux systems without an X server). An object created by the Tcl() object can have a Toplevel window created (and the Tk subsystem initialized) by calling its loadtk() method.
class tkinter.tix.Balloon  
A Balloon that pops up over a widget to provide help. When the user moves the cursor inside a widget to which a Balloon widget has been bound, a small pop-up window with a descriptive message will be shown on the screen.
class tkinter.tix.ButtonBox  
The ButtonBox widget creates a box of buttons, such as is commonly used for Ok Cancel.
class tkinter.tix.CheckList  
The CheckList widget displays a list of items to be selected by the user. CheckList acts similarly to the Tk checkbutton or radiobutton widgets, except it is capable of handling many more items than checkbuttons or radiobuttons.
class tkinter.tix.ComboBox  
The ComboBox widget is similar to the combo box control in MS Windows. The user can select a choice by either typing in the entry subwidget or selecting from the listbox subwidget.
class tkinter.tix.Control  
The Control widget is also known as the SpinBox widget. The user can adjust the value by pressing the two arrow buttons or by entering the value directly into the entry. The new value will be checked against the user-defined upper and lower limits.
class tkinter.tix.DirList  
The DirList widget displays a list view of a directory, its previous directories and its sub-directories. The user can choose one of the directories displayed in the list or change to another directory.
class tkinter.tix.DirSelectBox  
The DirSelectBox is similar to the standard Motif(TM) directory-selection box. It is generally used for the user to choose a directory. DirSelectBox stores the directories mostly recently selected into a ComboBox widget so that they can be quickly selected again.
class tkinter.tix.DirSelectDialog  
The DirSelectDialog widget presents the directories in the file system in a dialog window. The user can use this dialog window to navigate through the file system to select the desired directory.
class tkinter.tix.DirTree  
The DirTree widget displays a tree view of a directory, its previous directories and its sub-directories. The user can choose one of the directories displayed in the list or change to another directory.
class tkinter.tix.ExFileSelectBox  
The ExFileSelectBox widget is usually embedded in a tixExFileSelectDialog widget. It provides a convenient method for the user to select files. The style of the ExFileSelectBox widget is very similar to the standard file dialog on MS Windows 3.1.
class tkinter.tix.FileEntry  
The FileEntry widget can be used to input a filename. The user can type in the filename manually. Alternatively, the user can press the button widget that sits next to the entry, which will bring up a file selection dialog.
class tkinter.tix.FileSelectBox  
The FileSelectBox is similar to the standard Motif(TM) file-selection box. It is generally used for the user to choose a file. FileSelectBox stores the files mostly recently selected into a ComboBox widget so that they can be quickly selected again.
class tkinter.tix.Form  
The Form geometry manager based on attachment rules for all Tk widgets.
class tkinter.tix.HList  
The HList widget can be used to display any data that have a hierarchical structure, for example, file system directory trees. The list entries are indented and connected by branch lines according to their places in the hierarchy.
class tkinter.tix.InputOnly  
The InputOnly widgets are to accept inputs from the user, which can be done with the bind command (Unix only).
class tkinter.tix.LabelEntry  
The LabelEntry widget packages an entry widget and a label into one mega widget. It can be used to simplify the creation of “entry-form” type of interface.
class tkinter.tix.LabelFrame  
The LabelFrame widget packages a frame widget and a label into one mega widget. To create widgets inside a LabelFrame widget, one creates the new widgets relative to the frame subwidget and manage them inside the frame subwidget.
class tkinter.tix.ListNoteBook  
The ListNoteBook widget is very similar to the TixNoteBook widget: it can be used to display many windows in a limited space using a notebook metaphor. The notebook is divided into a stack of pages (windows). At one time only one of these pages can be shown. The user can navigate through these pages by choosing the name of the desired page in the hlist subwidget.
class tkinter.tix.Meter  
The Meter widget can be used to show the progress of a background job which may take a long time to execute.
class tkinter.tix.NoteBook  
The NoteBook widget can be used to display many windows in a limited space using a notebook metaphor. The notebook is divided into a stack of pages. At one time only one of these pages can be shown. The user can navigate through these pages by choosing the visual “tabs” at the top of the NoteBook widget.
class tkinter.tix.OptionMenu  
The OptionMenu creates a menu button of options.
class tkinter.tix.PanedWindow  
The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally. The user changes the sizes of the panes by dragging the resize handle between two panes.
class tkinter.tix.PopupMenu  
The PopupMenu widget can be used as a replacement of the tk_popup command. The advantage of the Tix PopupMenu widget is it requires less application code to manipulate.
class tkinter.tix.Select  
The Select widget is a container of button subwidgets. It can be used to provide radio-box or check-box style of selection options for the user.
class tkinter.tix.StdButtonBox  
The StdButtonBox widget is a group of standard buttons for Motif-like dialog boxes.
class tkinter.tix.tixCommand  
The tix commands provide access to miscellaneous elements of Tix’s internal state and the Tix application context. Most of the information manipulated by these methods pertains to the application as a whole, or to a screen or display, rather than to a particular window. To view the current settings, the common usage is: from tkinter import tix
root = tix.Tk()
print(root.tix_configure())
tixCommand.tix_addbitmapdir(directory)  
Tix maintains a list of directories under which the tix_getimage() and tix_getbitmap() methods will search for image files. The standard bitmap directory is $TIX_LIBRARY/bitmaps. The tix_addbitmapdir() method adds directory into this list. By using this method, the image files of an applications can also be located using the tix_getimage() or tix_getbitmap() method.
tixCommand.tix_cget(option)  
Returns the current value of the configuration option given by option. Option may be any of the configuration options.
tixCommand.tix_configure(cnf=None, **kw)  
Query or modify the configuration options of the Tix application context. If no option is specified, returns a dictionary all of the available options. If option is specified with no value, then the method returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the method modifies the given option(s) to have the given value(s); in this case the method returns an empty string. Option may be any of the configuration options.
tixCommand.tix_filedialog([dlgclass])  
Returns the file selection dialog that may be shared among different calls from this application. This method will create a file selection dialog widget when it is called the first time. This dialog will be returned by all subsequent calls to tix_filedialog(). An optional dlgclass parameter can be passed as a string to specified what type of file selection dialog widget is desired. Possible options are tix, FileSelectDialog or tixExFileSelectDialog.
tixCommand.tix_getbitmap(name)  
Locates a bitmap file of the name name.xpm or name in one of the bitmap directories (see the tix_addbitmapdir() method). By using tix_getbitmap(), you can avoid hard coding the pathnames of the bitmap files in your application. When successful, it returns the complete pathname of the bitmap file, prefixed with the character @. The returned value can be used to configure the bitmap option of the Tk and Tix widgets.
tixCommand.tix_getimage(self, name)  
Locates an image file of the name name.xpm, name.xbm or name.ppm in one of the bitmap directories (see the tix_addbitmapdir() method above). If more than one file with the same name (but different extensions) exist, then the image type is chosen according to the depth of the X display: xbm images are chosen on monochrome displays and color images are chosen on color displays. By using tix_getimage(), you can avoid hard coding the pathnames of the image files in your application. When successful, this method returns the name of the newly created image, which can be used to configure the image option of the Tk and Tix widgets.
tixCommand.tix_option_get(name)  
Gets the options maintained by the Tix scheme mechanism.
tixCommand.tix_resetoptions(newScheme, newFontSet[, newScmPrio])  
Resets the scheme and fontset of the Tix application to newScheme and newFontSet, respectively. This affects only those widgets created after this call. Therefore, it is best to call the resetoptions method before the creation of any widgets in a Tix application. The optional parameter newScmPrio can be given to reset the priority level of the Tk options set by the Tix schemes. Because of the way Tk handles the X option database, after Tix has been has imported and inited, it is not possible to reset the color schemes and font sets using the tix_config() method. Instead, the tix_resetoptions() method must be used.
class tkinter.tix.Tk(screenName=None, baseName=None, className='Tix')  
Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter. Classes in the tkinter.tix module subclasses the classes in the tkinter. The former imports the latter, so to use tkinter.tix with Tkinter, all you need to do is to import one module. In general, you can just import tkinter.tix, and replace the toplevel call to tkinter.Tk with tix.Tk: from tkinter import tix
from tkinter.constants import *
root = tix.Tk()
class tkinter.tix.TList  
The TList widget can be used to display data in a tabular format. The list entries of a TList widget are similar to the entries in the Tk listbox widget. The main differences are (1) the TList widget can display the list entries in a two dimensional format and (2) you can use graphical images as well as multiple colors and fonts for the list entries.
class tkinter.tix.Tree  
The Tree widget can be used to display hierarchical data in a tree form. The user can adjust the view of the tree by opening or closing parts of the tree.
class tkinter.Tk(screenName=None, baseName=None, className='Tk', useTk=1)  
The Tk class is instantiated without arguments. This creates a toplevel widget of Tk which usually is the main window of an application. Each instance has its own associated Tcl interpreter.
class tkinter.ttk.Combobox  
 
current(newindex=None)  
If newindex is specified, sets the combobox value to the element position newindex. Otherwise, returns the index of the current value or -1 if the current value is not in the values list. 
  
get()  
Returns the current value of the combobox. 
  
set(value)  
Sets the value of the combobox to value.
current(newindex=None)  
If newindex is specified, sets the combobox value to the element position newindex. Otherwise, returns the index of the current value or -1 if the current value is not in the values list.
class tkinter.ttk.Notebook  
 
add(child, **kw)  
Adds a new tab to the notebook. If window is currently managed by the notebook but hidden, it is restored to its previous position. See Tab Options for the list of available options. 
  
forget(tab_id)  
Removes the tab specified by tab_id, unmaps and unmanages the associated window. 
  
hide(tab_id)  
Hides the tab specified by tab_id. The tab will not be displayed, but the associated window remains managed by the notebook and its configuration remembered. Hidden tabs may be restored with the add() command. 
  
identify(x, y)  
Returns the name of the tab element at position x, y, or the empty string if none. 
  
index(tab_id)  
Returns the numeric index of the tab specified by tab_id, or the total number of tabs if tab_id is the string “end”. 
  
insert(pos, child, **kw)  
Inserts a pane at the specified position. pos is either the string “end”, an integer index, or the name of a managed child. If child is already managed by the notebook, moves it to the specified position. See Tab Options for the list of available options. 
  
select(tab_id=None)  
Selects the specified tab_id. The associated child window will be displayed, and the previously-selected window (if different) is unmapped. If tab_id is omitted, returns the widget name of the currently selected pane. 
  
tab(tab_id, option=None, **kw)  
Query or modify the options of the specific tab_id. If kw is not given, returns a dictionary of the tab option values. If option is specified, returns the value of that option. Otherwise, sets the options to the corresponding values. 
  
tabs()  
Returns a list of windows managed by the notebook. 
  
enable_traversal()  
Enable keyboard traversal for a toplevel window containing this notebook. This will extend the bindings for the toplevel window containing the notebook as follows:  
Control-Tab: selects the tab following the currently selected one. 
Shift-Control-Tab: selects the tab preceding the currently selected one. 
Alt-K: where K is the mnemonic (underlined) character of any tab, will select that tab.  Multiple notebooks in a single toplevel may be enabled for traversal, including nested notebooks. However, notebook traversal only works properly if all panes have the notebook they are in as master.
add(child, **kw)  
Adds a new tab to the notebook. If window is currently managed by the notebook but hidden, it is restored to its previous position. See Tab Options for the list of available options.
enable_traversal()  
Enable keyboard traversal for a toplevel window containing this notebook. This will extend the bindings for the toplevel window containing the notebook as follows:  
Control-Tab: selects the tab following the currently selected one. 
Shift-Control-Tab: selects the tab preceding the currently selected one. 
Alt-K: where K is the mnemonic (underlined) character of any tab, will select that tab.  Multiple notebooks in a single toplevel may be enabled for traversal, including nested notebooks. However, notebook traversal only works properly if all panes have the notebook they are in as master.
forget(tab_id)  
Removes the tab specified by tab_id, unmaps and unmanages the associated window.
hide(tab_id)  
Hides the tab specified by tab_id. The tab will not be displayed, but the associated window remains managed by the notebook and its configuration remembered. Hidden tabs may be restored with the add() command.
identify(x, y)  
Returns the name of the tab element at position x, y, or the empty string if none.
index(tab_id)  
Returns the numeric index of the tab specified by tab_id, or the total number of tabs if tab_id is the string “end”.
insert(pos, child, **kw)  
Inserts a pane at the specified position. pos is either the string “end”, an integer index, or the name of a managed child. If child is already managed by the notebook, moves it to the specified position. See Tab Options for the list of available options.
select(tab_id=None)  
Selects the specified tab_id. The associated child window will be displayed, and the previously-selected window (if different) is unmapped. If tab_id is omitted, returns the widget name of the currently selected pane.
tab(tab_id, option=None, **kw)  
Query or modify the options of the specific tab_id. If kw is not given, returns a dictionary of the tab option values. If option is specified, returns the value of that option. Otherwise, sets the options to the corresponding values.
class tkinter.ttk.Progressbar  
 
start(interval=None)  
Begin autoincrement mode: schedules a recurring timer event that calls Progressbar.step() every interval milliseconds. If omitted, interval defaults to 50 milliseconds. 
  
step(amount=None)  
Increments the progress bar’s value by amount. amount defaults to 1.0 if omitted. 
  
stop()  
Stop autoincrement mode: cancels any recurring timer event initiated by Progressbar.start() for this progress bar.
start(interval=None)  
Begin autoincrement mode: schedules a recurring timer event that calls Progressbar.step() every interval milliseconds. If omitted, interval defaults to 50 milliseconds.
step(amount=None)  
Increments the progress bar’s value by amount. amount defaults to 1.0 if omitted.
stop()  
Stop autoincrement mode: cancels any recurring timer event initiated by Progressbar.start() for this progress bar.
class tkinter.ttk.Spinbox  
 
get()  
Returns the current value of the spinbox. 
  
set(value)  
Sets the value of the spinbox to value.
configure(style, query_opt=None, **kw)  
Query or set the default value of the specified option(s) in style. Each key in kw is an option and each value is a string identifying the value for that option. For example, to change every default button to be a flat button with some padding and a different background color: from tkinter import ttk
import tkinter

root = tkinter.Tk()

ttk.Style().configure("TButton", padding=6, relief="flat",
   background="#ccc")

btn = ttk.Button(text="Sample")
btn.pack()

root.mainloop()
element_create(elementname, etype, *args, **kw)  
Create a new element in the current theme, of the given etype which is expected to be either “image”, “from” or “vsapi”. The latter is only available in Tk 8.6a for Windows XP and Vista and is not described here. If “image” is used, args should contain the default image name followed by statespec/value pairs (this is the imagespec), and kw may have the following options:  
 border=padding

padding is a list of up to four integers, specifying the left, top, right, and bottom borders, respectively.    
 height=height

Specifies a minimum height for the element. If less than zero, the base image’s height is used as a default.    
 padding=padding

Specifies the element’s interior padding. Defaults to border’s value if not specified.    
 sticky=spec

Specifies how the image is placed within the final parcel. spec contains zero or more characters “n”, “s”, “w”, or “e”.    
 width=width

Specifies a minimum width for the element. If less than zero, the base image’s width is used as a default.     If “from” is used as the value of etype, element_create() will clone an existing element. args is expected to contain a themename, from which the element will be cloned, and optionally an element to clone from. If this element to clone from is not specified, an empty element will be used. kw is discarded.
layout(style, layoutspec=None)  
Define the widget layout for given style. If layoutspec is omitted, return the layout specification for given style. layoutspec, if specified, is expected to be a list or some other sequence type (excluding strings), where each item should be a tuple and the first item is the layout name and the second item should have the format described in Layouts. To understand the format, see the following example (it is not intended to do anything useful): from tkinter import ttk
import tkinter

root = tkinter.Tk()

style = ttk.Style()
style.layout("TMenubutton", [
   ("Menubutton.background", None),
   ("Menubutton.button", {"children":
       [("Menubutton.focus", {"children":
           [("Menubutton.padding", {"children":
               [("Menubutton.label", {"side": "left", "expand": 1})]
           })]
       })]
   }),
])

mbtn = ttk.Menubutton(text='Text')
mbtn.pack()
root.mainloop()
lookup(style, option, state=None, default=None)  
Returns the value specified for option in style. If state is specified, it is expected to be a sequence of one or more states. If the default argument is set, it is used as a fallback value in case no specification for option is found. To check what font a Button uses by default: from tkinter import ttk

print(ttk.Style().lookup("TButton", "font"))
map(style, query_opt=None, **kw)  
Query or sets dynamic values of the specified option(s) in style. Each key in kw is an option and each value should be a list or a tuple (usually) containing statespecs grouped in tuples, lists, or some other preference. A statespec is a compound of one or more states and then a value. An example may make it more understandable: import tkinter
from tkinter import ttk

root = tkinter.Tk()

style = ttk.Style()
style.map("C.TButton",
    foreground=[('pressed', 'red'), ('active', 'blue')],
    background=[('pressed', '!disabled', 'black'), ('active', 'white')]
    )

colored_btn = ttk.Button(text="Test", style="C.TButton").pack()

root.mainloop()
 Note that the order of the (states, value) sequences for an option does matter, if the order is changed to [('active', 'blue'), ('pressed',
'red')] in the foreground option, for example, the result would be a blue foreground when the widget were in active or pressed states.
theme_create(themename, parent=None, settings=None)  
Create a new theme. It is an error if themename already exists. If parent is specified, the new theme will inherit styles, elements and layouts from the parent theme. If settings are present they are expected to have the same syntax used for theme_settings().