Reference 〉Class

checkEntry( tkinter.Frame parent = None, str title = None, int width = 20, str bg = '#FFFFFF', tuple(str,int) font = ('Lucida Grande',12), bool|str|int default = '', str type = 'string', func(val) command = None )

A combination checkbox/textbox GUI element that returns False when the checkbox is unchecked, and the value of the textbox when the checkbox is checked.

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 custom checkEntry is with the higher-level model.addParameter() instead, setting the type parameter to 'checkentry'.

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 element should be attached.

    Default value: None

  • title str, optional

    The label for the element.

    Default value: None

  • width int, optional

    The width of the textbox.

    Default value: 20

  • bg str, optional

    The background color of the element.

    Default value: '#FFFFFF'

  • font tuple(str,int), optional

    A font name/size pair.

    Default value: ('Lucida Grande',12)

  • default bool|str|int, optional

    The initial value of the check entry.

    Default value: ''

  • type str, optional

    Can be set to 'int' to limit the textbox to numeric input.

    Default value: 'string'

  • command func(val), optional

    A callback function that takes one argument, the value of the checkEntry.

    Default value: None

Methods

Click a method name for more detailed documentation.

  • disabled( disable )

    Enables or disables the checkEntry element. This function is aliased by both checkEntry.enable() and checkEntry.disable().

  • disable( )

    Disable the checkEntry element so it cannot be interacted with by the user.

  • enable( )

    Enables the checkEntry element so that it can be interacted with by the user.

  • set( value )

    Sets the value of the checkEntry element. Pass a bool to activate or deactivate the checkbox, and pass a str or int to change the value of the textbox.

  • get( )

    Retrieves the value of the combined checkEntry element: False if the checkbox is unchecked, and the value of the textbox if the checkbox is checked.

  • disableTextfield( )

    Updates the enabled state of the text field to correspond to the value of the checkbox.

Properties

  • enabled bool

    Whether or not the user can currently interact with the element.

    Initial value: True

  • entryValue tkinter.StringVar

    The value of the textbox, regardless of the state of the checkbox. Use checkEntry.entryValue.get() to get a string value.

  • textbox tkinter.Entry

    The textbox element.

  • checkVar tkinter.BooleanVar

    The value of the checkbox. Use checkEntry.checkVar.get() to get a boolean value.

  • checkbox tkinter.Checkbutton

    The checkbox element.

  • callback func(val)

    The callback function entered in the command argument.

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