Tkinter: which ttk widget for database table primary key?

Christian Gollwitzer auriocus at gmx.de
Wed Mar 18 17:18:31 EDT 2020


Am 18.03.20 um 21:39 schrieb Rich Shepard:
> Subject might be confusing so I'll expand it here.
> 
> My application uses a database backend in which each table has a unique and
> database-generated sequential numeric key. I want to display that key in 
> the
> GUI for that class but it's not entered by the user or altered. It seems to
> me that the ttk.Entry and ttk.Spinbox widgets are inappropriate. As a
> newcomer to Tkinter I ask for advice on which widget to use.

You can use an Entry and set it to readonly state. Or you can use a 
Label. The advantage of the readonly Entry is, that the user can still 
copy/paste the content, and that it can scroll if the string is very long.

Christian


More information about the Python-list mailing list