this script should help you see what is going on 'under the hood'
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
c = ttk.Combobox(root)
c.grid()
style = 'TCombobox'
s = ttk.Style()
elements = s.layout(style)
def get_element_details(elem, _dict, depth=1):
print('%selement: %s' % (''.join(['\t' for s in range(depth)]), elem))
for key in _dict:
if key != 'children':
print('%s%s: %s' % (''.join(['\t' for s in range(depth+1)]), key, _dict[key]))
print('%soption: %s' % (''.join(['\t' for s in range(depth+1)]), s.element_options(elem)))
if 'children' in _dict:
for child, child_dict in _dict['children']:
get_element_details(child, child_dict, depth+1)
print('element: %s' % style)
print('option: %s' % str(s.element_options(style)))
for elem, elem_dict in elements:
get_element_details(elem, elem_dict)
so for the style given it loops through the layout for each of the child elements, and returns layout info and options for each recursively.
when running this for Combobox i get:
element: TCombobox
option: ()
element: Combobox.field
sticky: nswe
option: ()
element: Combobox.downarrow
side: right
sticky: ns
option: ()
element: Combobox.padding
expand: 1
sticky: nswe
option: ('-padding', '-relief', '-shiftrelief')
element: Combobox.focus
expand: 1
sticky: nswe
option: ('-focusfill',)
element: Combobox.textarea
sticky: nswe
option: ('-font', '-width')
however when i tried:
s.configure('Combobox.padding', relief='flat', shiftrelief='flat')
or
s.configure('TCombobox.padding', relief='flat', shiftrelief='flat')
on windows I didn't see a change in the borders, it may not be implemented in the python bindings.
Edit:
also there is a library Pwm that builds widgets from other tkinter widgets, meaning that (with a fair bit of work) you can re style those sub widgets, but i find the combobox from Pwm looks worse than ttk's version