Мне удалось решить проблему. Оставить это для записи любому, кому это может понадобиться. Проблема root заключается в том, что «custom.Horizont.Scale.trough» нельзя использовать дважды. Изменение его на «custom.Horizont.Scale.trough2» или «custom.Horizont.Scale2.trough» не работает. Однако изменение строки «custom» может работать. Каждый раз, когда вызывается эта функция, можно использовать разные строки, не влияя на функциональность. Вот что я сделал:
i=1
def create_style():
global img_trough
global img_slider
global startup
global i
if startup=="no":
img_trough = PhotoImage(file="bar.gif")
img_slider = PhotoImage(file="slider.gif")
if startup=="yes":
img_trough = PhotoImage(file="bar_small.gif")
img_slider = PhotoImage(file="slider_small.gif")
print("called", i, "th time")
i=i+1
# create scale elements
string_trough=str(i)+'.custom.Horizontal.Scale.trough'
string_slider=str(i)+'.custom.Horizontal.Scale.slider'
style.element_create(string_trough, 'image', img_trough)
style.element_create(string_slider, 'image', img_slider)
# create custom layout
style.layout('custom.Horizontal.TScale',[(string_trough, {'sticky': 'ns'}),(string_slider, {'side': 'left', 'sticky': '','children': [('custom.Horizontal.Scale.label', {'sticky': ''})]})])