arcrange | Arc range in degree. |
arcoffset | Offset from starting position in degree, 0 position is at 3'Oclock . |
amounttotal | The maximum value of the Arc |
amountused | Current Meter value, displayed at center if showtext is True. |
wedgesize | The length of the wedge if not equal to 0 . |
metersize | Size of one side of the Meter ( as a squre ). |
arcrange | Arc range in degree. |
bootstyle | Style keyword, options are primary, secondary, success,info,warning,danger, light, dark |
metertype | FULL or SEMI |
meterthickness | Thickness of indicator. |
showtext | True / False, Show the text. |
interactive | If True then indicator can be adjusted using Mouse |
stripethickness | If greater than 0 then striped bands with thickness is shown. |
textleft | At the left of center text. |
textright | At the right of center text. |
textfont | Font for the center text. textfont=['Times',10,'bold'] |
subtext | Supplemental text below center text. |
subtextstyle | Bootstyle colour of subtext. |
subtextfont | Font for subtext . |
stepsize | Step size of increment on Mouse interaction. |
**kwargs | Other keyword arguments. |
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
my_w = ttk.Window()
my_w.geometry("400x220")
b1 = ttk.Meter(
my_w,
amountused=85,
metersize=200,
meterthickness=30,
bootstyle=WARNING,
)
b1.grid(row=1, column=1, padx=10, pady=10)
my_w.mainloop()
b1.configure(amountused=25,interactive=True)
interactive=True
and display the same value on a Button.
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
my_w = ttk.Window()
my_w.geometry("400x220") # width and height
b1 = ttk.Meter(
my_w,
amountused=65,
meterthickness=30,
bootstyle=WARNING,
interactive=True
)
b1.grid(row=1, column=1, padx=10, pady=10)
l2=ttk.Button(my_w,textvariable=b1.amountusedvar,bootstyle=DANGER)
l2.grid(row=1,column=2,padx=10)
my_w.mainloop()
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
my_w = ttk.Window()
my_w.geometry("720x80")
c=0 # column value
for my_style in my_w.style.colors: # List of styles
m1 = ttk.Meter(
subtext=my_style,subtextfont=['Times',6,'normal'],
textfont=['Times',6,'bold'],metersize=80,
amountused=65, bootstyle=my_style
)
m1.grid(row=1, column=c,padx=5)
c = c + 1
my_w.mainloop()
b1 = ttk.Meter(
my_w,
amountused=65,
meterthickness=30,
bootstyle=INFO,
interactive=True,
textfont=['Times',26,'bold'],
textright='%',
textleft='Speed',
subtext='Performance',
subtextfont=['Times',10,'normal'],
subtextstyle=SECONDARY
)
gap_sec=1000 # milliseconds
my_w.after(gap_sec,my_second)
Full code is here
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
my_w = ttk.Window()
my_w.geometry("220x260") # width and height
m1 = ttk.Meter(
my_w,
amounttotal=59,
amountused=0,
meterthickness=20,
bootstyle=INFO,
metersize=200,
stripethickness=6
)
m1.grid(row=1, column=1, padx=5, pady=10)
count=0
gap_sec=10 # Time delay in Millseconds
def my_second():
global count
if count <=59:
m1['amountused']=count # update meter value
count=count+1
my_w.after(gap_sec,my_second) # time delay in Milli seconds
else:
count=0
b1=ttk.Button(my_w,text='Start',command=my_second)
b1.grid(row=2,column=1)
my_w.mainloop()
Ttkbootstrap Meter bootstyle option using range Two Interlinked Meters Displaying number of chars entered in Text widget using Meter