ttk.Button color

#======================
# imports
#======================
from tkinter import ttk
from tkinter import *
from tkinter.ttk import *
import tkinter 
import sys
import time


# Create instance
win = tkinter.Tk()
win.configure(background='blue')

s=ttk.Style()
#s.configure('bak.ground', background=('blue'))
s.configure('.', font=('Helvetica', 12, 'bold'), background='blue', foreground='white')
s.configure('JS.TButton', font=('Helvetica', 12), background='blue', foreground='black')


# Add a title
win.overrideredirect(1)
# win.title("Simconnect")
win.geometry("200x50+50-50")


# Modify adding a Label using mighty as the parent instead of win
a_label = ttk.Label(win, text="Alti.")
a_label.grid(column=0, row=0, sticky='W', padx=2 )

# Modify adding a Label using mighty as the parent instead of win
sp_label = ttk.Label(win, text="Speed")
sp_label.grid(column=1, row=0, sticky='W', padx=2)

# Exit GUI cleanly
def _quit():
    win.quit()
    win.destroy()
    exit()

	
btstop = ttk.Button(win, text="Stop", command=_quit, style='JS.TButton')
btstop.grid(column=11, row=1)

#======================
# Start GUI
#======================
win.mainloop()

Hi,
I have this code and I get this:
2021-02-22 17-19-41

I would like to have the button color blue, but I don’t how!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.