Tkinter: which ttk widget for database table primary key?

Rich Shepard rshepard at appl-ecosys.com
Wed Mar 18 18:04:01 EDT 2020


On Wed, 18 Mar 2020, MRAB wrote:

> You can make the Entry widget read-only:
>    entry_widget['state'] = 'readonly'
> The user will still be able to copy from it.
>
> Alternatively, you can disable it:
>
>    entry_widget['state'] = 'disabled'
>
> The user won't be able to copy from it.
>
> When updating the GUI, you'll need to make it writeable if you have it 
> currently read-only or disabled:
>
>    entry_widget['state'] = 'normal'
>    :
>    # Change the contents here.
>    :
>    entry_widget['state'] = 'readonly'

MRAB,

Thanks very much for expanding on Christian's response. This is the widget
I'll use and set it to 'readonly'.

Regards,

Rich


More information about the Python-list mailing list