Reference 〉Class

logSlider( tkinter.Frame parent = None, str title = None, func(num) command = None, str bg = '#FFFFFF', tuple(str,int) font = ('Lucida Grande', 12), list[num] values = [],  **kwargs )

A Tkinter GUI slider element that slides along user-defined intervals, rather than being limited to linear intervals as in the default slider element. Used in the refresh rate slider in the control panel.

This class inherits from tkinter.Frame and will contain all the methods and properties of that class as well. These are not listed here.

Note that this is a Tkinter widget and thus will not work in other frontends like Jupyter notebooks. The recommended way to draw a log slider is with the higher-level model.addParameter() instead, setting the type parameter to 'slider' and the opts parameter to a list of ints.

WARNING: This is an internal class. Its use in user code is not recommended or supported, and its signature can change in future updates without warning. Use one of the suggested functions above instead, if applicable.

Initialization Parameters

  • parent tkinter.Frame, optional

    The Tkinter frame to which the log slider should be attached.

    Default value: None

  • title str, optional

    A label for the log slider, displayed above the slider element.

    Default value: None

  • command func(num), optional

    A callback function that runs when the slider is changed, and is passed the value of the slider as its only argument.

    Default value: None

  • bg str, optional

    The background hex color of the logSlider element.

    Default value: '#FFFFFF'

  • font tuple(str,int), optional

    A font name/size pair.

    Default value: ('Lucida Grande', 12)

  • values list[num], optional

    A list of discrete values that the slider should slide over.

    Default value: []

  • **kwargs optional

    Additional arguments will be passed to the Tkinter Scale element, with the exception of to, from, and showvalue. Re-specifying any of these arguments will result in an error. See the list of valid arguments that can be passed to the element.

    Default value: None

Methods

Click a method name for more detailed documentation.

  • disabled( val )

    Enables or disables interaction with the slider.

  • enable( )

    Enables interaction with the slider.

  • disable( )

    Disables interaction with the slider.

  • set( val )

    Set the value of the log slider. The slider can be set to a value other than those listed in self.values, but the position of the slider will not update if it is not.

  • get( )

    Returns the current value of the slider.

Properties

  • values list[num]

    A list of discrete values that the slider should slide over.

    Initial value: []

  • extCommand func(num)

    A callback function that runs when the slider is changed, and is passed the value of the slider as its only argument.

    Initial value: None

  • slide tkinter.Scale

    The Tkinter slider element used in the log slider frame.

  • text tkinter.Label

    The text to the side indicating the current value of the slider.

  • number num

    The current value of the log slider.

    Initial value: 0

Notes and Examples

  1. Contribute a Note

    Your email address will not be published. Required fields are marked *

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.

History