Advertisement
AceScottie

LoadingBar_example.py

Mar 7th, 2024
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | Source Code | 0 0
  1. from rapidTk import *
  2. class GUI:
  3.     def __init__(self):
  4.         self.root = rapidTk()
  5.         self.root.geometry("400x120")
  6.         self.root.resizable(0,0)
  7.     def main(self):
  8.         pp=PackProcess()
  9.         f1 = pp.add(cFrame(self.root), side=TOP, pady=5)
  10.         f2 = pp.add(cFrame(self.root), side=TOP)
  11.         f3 = pp.add(cFrame(self.root), side=TOP)
  12.         pp.add(cLabel(f1, text="mode: indeterminate"), side=TOP)
  13.         lb1 = pp.add(LoadingBar(f1, mode="indeterminate", borderwidth=2, relief="raised", width=375, height=15, background="white", increment=2, delay=0.025), side=TOP)
  14.         pp.add(cLabel(f2, text="mode: determinate"), side=TOP)
  15.         lb2 = pp.add(LoadingBar(f2, mode="determinate", borderwidth=2, relief="raised", width=375, height=15, background="white", increment=30, delay=0.1), side=TOP)
  16.         pp.add(cLabel(f3, text="mode: flow"), side=TOP)
  17.         lb3 = pp.add(LoadingBar(f3, mode="flow", borderwidth=2, relief="raised", width=375, height=15, background="white", increment=2, delay=0.01), side=TOP)
  18.         lb1.bar_config(background="#3399ff", width=20)
  19.         lb2.bar_config(background="#3399ff")
  20.         lb3.bar_config(background="#3399ff")
  21.         lb1.start()
  22.         lb2.set(50)
  23.         lb3.set(75)
  24.         pp.pack()
  25.         self.root.mainloop()
  26. if __name__ == "__main__":
  27.     app=GUI()
  28.     app.main()
Tags: python rapidTk
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement