ScaleEntry

class ttkwidgets.ScaleEntry(master=None, scalewidth=50, entrywidth=5, from_=0, to=50, orient='horizontal', compound='right', entryscalepad=0, **kwargs)[source]

Bases: ttk.Frame

A simple combination of a Scale and an Entry widget suitable for use with int ranges.

__init__(master=None, scalewidth=50, entrywidth=5, from_=0, to=50, orient='horizontal', compound='right', entryscalepad=0, **kwargs)[source]

Create a ScaleEntry.

Parameters:
  • master (widget) – master widget
  • scalewidth (int) – width of the Scale in pixels
  • entrywidth (int) – width of the Entry in characters
  • from_ (int) – start value of the scale
  • to (int) – end value of the scale
  • orient (str) – scale orientation. Supports tk.HORIZONTAL and tk.VERTICAL
  • compound (str) – side the Entry must be on. Supports tk.LEFT, tk.RIGHT, tk.TOP and tk.BOTTOM
  • entryscalepad (int) – space between the entry and the scale
  • kwargs – keyword arguments passed on to the ttk.Frame initializer
class LimitedIntVar(low, high)[source]

Bases: Tkinter.IntVar

Subclass of tk.IntVar that allows limits in the value of the variable stored.

configure(**kwargs)[source]

Configure the limits of the LimitedIntVar.

set(value)[source]

Set a new value.

Check whether value is in limits first. If not, return False and set the new value to either be the minimum (if value is smaller than the minimum) or the maximum (if the value is larger than the maximum). Both str and int are supported as value types, as long as the str contains an int.

Parameters:value (int) – new value
cget(key)[source]

Query widget option.

Parameters:key (str) – option name
Returns:value of the option

To get the list of options for this widget, call the method keys().

cget_entry(key)[source]

Query the Entry widget’s option.

Parameters:key (str) – option name
Returns:value of the option
cget_scale(key)[source]

Query the Scale widget’s option.

Parameters:key (str) – option name
Returns:value of the option
config(cnf={}, **kw)

Configure resources of the widget.

To get the list of options for this widget, call the method keys(). See __init__() for a description of the widget specific option.

config_entry(cnf={}, **kwargs)[source]

Configure resources of the Entry widget.

config_scale(cnf={}, **kwargs)[source]

Configure resources of the Scale widget.

configure(cnf={}, **kw)[source]

Configure resources of the widget.

To get the list of options for this widget, call the method keys(). See __init__() for a description of the widget specific option.

value

Get the value of the LimitedIntVar instance of the class.