'children': [('Button.label', { 'expand': 0 })] })] })] })] }, 'Button.button': { "element create": ('image', "button", ('pressed', "button-p"), ('selected', "button-s"), ('active', "button-s"), ('disabled', "button-d"), { 'border': [52, 65, 47, 17], 'padding': [12, 54, 8, 16], 'sticky': "nsew" }) } # end of theme extract - don't forget to add comma at end when inserting }) style.theme_use('default') #('yummy') # widg = Button(fr, text='Piratz!') widg.grid(column=0, row=11, padx=5, pady=5) #sticky='nsew', widg1 = Button(fr, text='Piratz!\nextra line made longer') widg1.grid(column=0, row=12, padx=5, pady=5) # sticky='nsew', run_state(fr, widg, widg1) root.mainloop()
style = Style() # both theme_create and theme_settings worked style.theme_create( "yummy", parent="clam", settings={ #style.theme_settings('default', { # start of theme extract 'Radiobutton.indicator': { "element create": ('image', "radio-n", ('disabled', 'selected', "radio-ds"), ('disabled', "radio-d"), ('selected', "radio-s"), { 'width': 20, 'sticky': "w" }) } # end of theme extract - don't forget to add comma at end when inserting }) style.theme_use('yummy') # 'default' happy = ['Great', 'Good', 'OK', 'Poor', 'Awful'] happiness = StringVar() for ix, s in enumerate(happy): widg = Radiobutton(fr, text=s, value=s, variable=happiness) widg.grid(column=0, row=11 + ix, sticky='nw') run_state(fr, widg) root.mainloop()