Python Forum
[Tkinter] RE: status bar to return to the centre after 1 minute of clicking a button ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] RE: status bar to return to the centre after 1 minute of clicking a button ?
#1
Hello,can you tell me how the statuss bar after i move with button to return it alone after 1 minute in centre.Thank you
import tkinter as tk
import tkinter.ttk as ttk

root = tk.Tk()

progressbar = ttk.Progressbar(root, length=200, maximum=10, value=5)
progressbar.grid(row=1)

process = tk.IntVar(value=5)
def add_water():
    if process.get() < progressbar['maximum']:
        process.set( process.get() + 1)
        progressbar['value'] = process.get()

def sub_water():
    if process.get() > 0:
        process.set( process.get() - 1)
        progressbar['value'] = process.get()

add = ttk.Button(root, text='Water +', command=add_water)
sub = ttk.Button(root, text='Water -', command=sub_water)

label = ttk.Label(root, textvariable=process)

label.grid(row=0)
add.grid(row=0, sticky='e')
sub.grid(row=0, sticky='w')

root.mainloop()
 
Reply


Messages In This Thread
RE: status bar to return to the centre after 1 minute of clicking a button ? - by chano - May-21-2019, 03:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Clicking on the button crashes the TK window ODOshmockenberg 1 2,258 Mar-10-2022, 05:18 PM
Last Post: deanhystad
  adding button status updates to countdown counter knoxvilles_joker 7 3,424 Apr-18-2021, 01:59 AM
Last Post: knoxvilles_joker
  [Tkinter] showing return from button on main screen blazejwiecha 4 2,674 Nov-22-2020, 04:33 PM
Last Post: blazejwiecha
  Need tkinter help with clicking buttons pythonprogrammer 2 2,484 Jan-03-2020, 04:43 AM
Last Post: joe_momma
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 5,042 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp
  tkinter- adding a new window after clicking a button built on the gui ShashankDS 2 6,645 Apr-18-2019, 12:48 PM
Last Post: ShashankDS
  [Tkinter] Adding New TAB to NoteBook Widget by Clicking Vicolas 0 2,631 Feb-15-2019, 06:03 PM
Last Post: Vicolas
  [Tkinter] Clicking a RadioButton in a for Loop & Getting the Appropriate Return Vicolas 1 5,183 Feb-02-2019, 01:53 AM
Last Post: woooee
  [Tkinter] How to get & delete details from each input by clicking a button Vicolas 6 3,869 Feb-01-2019, 11:00 AM
Last Post: Vicolas
  [PyQt] No reaction and no error message when clicking button Atalanttore 4 4,837 Nov-23-2018, 01:48 PM
Last Post: Atalanttore

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020