Reference 〉 Class

checkEntry(parenttkinter.FrameNone, titlestrNone, widthint20, bgstr'#FFFFFF', fonttuple(str,int)('Lucida Grande',12), defaultbool|str|int'', datatypestr'string', commandfunc(val)None)

Checkentries in Tkinter
A disabled integer-type checkentry and an enabled
text-type checkentry in the Tkinter frontend.

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 Params.add() 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: ''

  • datatype 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


Click a method name for more detailed documentation.

  • disable( )

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

  • disabled( disable )

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

  • enable( )

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

  • get( )

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

  • 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.

  • disableTextfield( )

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

Object 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|tkinter.Spinbox

    The textbox element, an Entry if type=='string' or Spinbox if type=='int'.

  • 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.