Python Forum
[Tkinter] status bar controll with buttons - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: [Tkinter] status bar controll with buttons (/thread-18355.html)



status bar controll with buttons - chano - May-14-2019

Hello dears,Can you help me?
How i move this bar with the buttons?
Or offer a better solution.
Thank you much
import tkinter as tk
from tkinter import *
from tkinter import ttk
from tkinter import Tk, Toplevel, Button


master = Tk()
master1 = Toplevel()
master2= Toplevel()

master.minsize(150,150+170+170)
master.geometry("10x800+1220+0")
master.configure(background="black",)
master.title("tonik 1")
master.overrideredirect(True)

master1.minsize(150,150+170+170)
master1.geometry("10x1000")
master1.configure(background="green",)
master1.title("tonik 1")
master1.overrideredirect(True)

master2.minsize(1000,10+0+0)
master2.geometry("1500x120+0+0")
master2.configure(background="yellow",)
master2.title("tonik 1")
master2.overrideredirect(True)
############################################
p = progressbar = ttk.Progressbar(master2,orient = HORIZONTAL, length = 200)

progressbar.pack()
progressbar.config(mode = 'indeterminate')
progressbar.start()
progressbar.stop()
progressbar.config(mode ='determinate',maximum = 10.0, value = 10.2)
progressbar.config(value = 5.0)
p.place(x = 600, y = 80)
progressbar.step()
progressbar.step()
progressbar.step()
progressbar.step()
progressbar.step()
progressbar.step()
progressbar.step()
progressbar.step()
progressbar.step(12)


 
    ###############################                                                                                       


image3 = tk.PhotoImage(file="C:\Program Files\Python37\kap2.gif")
b = button = tk.Button(master2,image=image3, height=40, width=130,background="white",font="0",bd=10,fg="black")
b.place(x = 530, y = 0)
label2=Label(master2,text="  sugar-",height=1, width=15,bg="yellow",font="Times 13",fg="black",relief="solid",bd=0).place(x=535,y=60)

image2 = tk.PhotoImage(file="C:\Program Files\Python37\kap1.gif")
b = button = tk.Button(master2,image=image2, height=40, width=130,background="white",font="0",bd=10,fg="black")
b.place(x = 690, y = 0)
label2=Label(master2,text="  sugar+",height=1, width=15,bg="yellow",font="Times 13",fg="black",relief="solid",bd=0).place(x=695,y=60)


master.mainloop()



RE: status bar controll with buttons - Larz60+ - May-14-2019

Not sure what you're trying to do, A progress bar is usually tied to a process, and advanced at calculated intervals during the process.


RE: status bar controll with buttons - woooee - May-15-2019

Buttons call a function, which would increment the progress bar, if that is what you want. Your buttons do not call a function.


RE: status bar controll with buttons - chano - May-15-2019

(May-15-2019, 02:00 AM)woooee Wrote: Buttons call a function, which would increment the progress bar, if that is what you want. Your buttons do not call a function.

Hello,thank for you answer,
yes,i want this ,but how i make this function?i don't know.
can you help me?

(May-14-2019, 08:21 PM)Larz60+ Wrote: Not sure what you're trying to do, A progress bar is usually tied to a process, and advanced at calculated intervals during the process.
Thank you for you answer,
i want when push button sugar+ ,the progress bar muve one step right,when push the sugar -,the progres bar move one step left.Is it possible i don't now.
Thank you for help.


RE: status bar controll with buttons - woooee - May-15-2019

Every tutorial addresses how to code a button. Tutorials are write once, read many, so we don't have to answer the same beginner questions over and over https://wiki.python.org/moin/TkInter
http://effbot.org/tkinterbook/