Floodgauge widget of ttkbootstrap

Ttkbootstrap Floodgauge
A progress indicator of any process which can display the value.


Parameters


cursorShape of the mouse over the widget, List of Cursor shapes are here .
fontfont style of the Label over it ['Family',size, 'style'] ,
lengthLength of the long axis, it is width if orientation is horizontal, otherwise height.
maximumMaximum value (default 100)
modedeterminate (default ) | indeterminate.
If the value is not known during the process then indeterminate mode is to be used.
The rectanble will bounce back and forth indicating the progress is on.
bootstyleStyle keyword, options are
primary, secondary, success,info,warning,danger, light, dark
takefocus False ( default ), If it is set to True then widget is included in focus traversal.
textText to be displayed , associated with floodgauge.textvariable.
valueFloat, the current value of Floodgauge.
maskA string format to show the value ( See examples below )
**kwargsOther keyword arguments.


Floodgauge to display process progress and managing using parameters #10



Ttkbootstrap Floodgauge Parameters

import ttkbootstrap as ttk
from ttkbootstrap.constants import *

my_w = ttk.Window()
my_w.geometry("400x100")  # width and height
c=0 # column value 
fg1 = ttk.Floodgauge(
    bootstyle=INFO,
    mask='INFO ' + '{}%',
    value=40,
    maximum=100,
    length=350    
    )
fg1.grid(row=1, column=1,padx=15,pady=10)

my_w.mainloop()

configure()

We can manage parameters by using configure().
fg1.configure(value=65,orient='vertical')

Displaying value

Ttkbootstrap Floodgauge value display
We will update the Floodgauge by using a button, each click of the button will increase the value by 10 and display the same value on a Label.
import ttkbootstrap as ttk
from ttkbootstrap.constants import *

my_w = ttk.Window()
my_w.geometry("620x320")  # width and height

fg = ttk.Floodgauge(
    bootstyle=INFO,
    font=(None, 10, 'bold'),
    mask='Memory {}%',
    value=15,
    maximum=100,
    length=500,
)
fg.grid(row=1, column=1, padx=10, pady=10,columnspan=3)

def my_upd():
    fg.variable.set(fg.variable.get()+10) # increaes value by 10
    l2.configure(text=str(fg.variable.get())) # Show on Label 

b1=ttk.Button(my_w,text='Jump',command=my_upd,bootstyle=SUCCESS)
b1.grid(row=2,column=1,padx=10,pady=20)

l2=ttk.Button(my_w,text=str(fg.variable.get()),bootstyle=DANGER)
l2.grid(row=2,column=2,padx=10,pady=20)

my_w.mainloop()

Using bootstyle parameter

Ttkbootstrap floodgauge styles
Inside a for loop we can add different available bootstrap style colours by using bootstyle parameter.
import ttkbootstrap as ttk
from ttkbootstrap.constants import *

my_w = ttk.Window()
my_w.geometry("870x100")  # width and height
c=0 # column value 
for my_style in my_w.style.colors:  # List of styles
    fg = ttk.Floodgauge(
    bootstyle=my_style,
    font=(None, 8, 'bold'),
    mask=my_style +' {}%',
    value=40,
    maximum=100,
    
    )
    fg.grid(row=1, column=c,padx=4,pady=10)
    c = c + 1

my_w.mainloop()
Start() stop() autoincrement of Floodgauge Displaying number of chars entered in Text widget using Floodgauge
ttkbootstrap
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer