Structure of tkinter's configure dictionary

What is a common structure of the tkinter’s configure() dictionary?

For example, if I get a dictionary for Label: ``{‘background’: (‘background’, ‘frameColor’, ‘FrameColor’, ‘’, ‘’), ‘foreground’: (‘foreground’, ‘textColor’, ‘TextColor’, ‘’, ‘’), ‘font’: (‘font’, ‘font’, ‘Font’, ‘’, ‘’), ‘borderwidth’: (‘borderwidth’, ‘borderWidth’, ‘BorderWidth’, ‘’, ‘’), ‘relief’: (‘relief’, ‘relief’, ‘Relief’, ‘’, ‘’), ‘anchor’: (‘anchor’, ‘anchor’, ‘Anchor’, ‘’, ‘’), ‘justify’: (‘justify’, ‘justify’, ‘Justify’, ‘’, ‘’), ‘wraplength’: (‘wraplength’, ‘wrapLength’, ‘WrapLength’, ‘’, ‘’), ‘takefocus’: (‘takefocus’, ‘takeFocus’, ‘TakeFocus’, ‘’, ‘’), ‘text’: (‘text’, ‘text’, ‘Text’, ‘’, ‘’), ‘textvariable’: (‘textvariable’, ‘textVariable’, ‘Variable’, ‘’, ‘’), ‘underline’: (‘underline’, ‘underline’, ‘Underline’, -1, -1), ‘width’: (‘width’, ‘width’, ‘Width’, ‘’, ‘’), ‘image’: (‘image’, ‘image’, ‘Image’, ‘’, ‘’), ‘compound’: (‘compound’, ‘compound’, ‘Compound’, ‘’, ‘’), ‘padding’: (‘padding’, ‘padding’, ‘Pad’, ‘’, ‘’), ‘state’: (‘state’, ‘state’, ‘State’, <index object: ‘normal’>, <index object: ‘normal’>), ‘cursor’: (‘cursor’, ‘cursor’, ‘Cursor’, ‘’, ‘’), ‘style’: (‘style’, ‘style’, ‘Style’, ‘’, ‘’), ‘class’: (‘class’, ‘’, ‘’, ‘’, ‘’)}, I would like to know, weather there is a set structure and units within tuples have some general characteristics or not. Why there is twice the same in the brackets, so what are the rules behind this dictionary.

From the TkDocs tutorial; scroll down to the “Configuration Options” heading:

Ok, if you really want to know, here are the details on the five pieces of data provided for each configuration option. The most useful are the first, the option’s name, and the fifth, which is the option’s current value. The fourth is the default value of the option, or in other words, the value it would have if you didn’t change it. The other two relate to something called the option database. We’ll touch on it when we discuss menus, but it’s not used in modern applications. The second item is the option’s name in the database, and the third is its class.

So to answer your question, it seems the order of the elements within each value tuple is significant.

1 Like