I am using tkiner mesagebox and ttk progressbar with Python 3. I try to set a text window in one line and a progressbar in the next line. This is working so far, but I am not able to change the colour from green (default) to another value. With this post How to change ttk.progressBar color in python I was able to turn the colour to black, but then I don't know how to get the text over it. Can someone help me?
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
#bar in green with text
root = Tk()
gpw_l1 = Label(root, text="This should be a black bar")
gpw_l2 = ttk.Progressbar(root, orient="horizontal", length=500, mode="determinate")
gpw_l2.grid(row=2, column=0, pady=10)
gpw_l2["maximum"] = 1.0
x = 0.7
gpw_l2["value"] = x
gpw_l1.grid(row=0, columnspan=2)
gpw_l2.grid(row=1, columnspan=2)
root.geometry('+100+200')
root.mainloop()
root.quit()
#bar in red, but no text
root2 = Tk()
frame = Frame(root2)
frame.grid()
s = ttk.Style()
s.theme_use('clam')
s.configure("red.Horizontal.TProgressbar", foreground='red', background='black')
ttk.Progressbar(frame, style="red.Horizontal.TProgressbar", orient="horizontal", length=600, mode="determinate",
maximum=4, value=1).grid(row=1, column=1)
frame.pack()
root2.mainloop()
root2.quit()