Python Forum
[Tkinter] status bar controll with buttons
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] status bar controll with buttons
#1
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()
Reply
#2
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.
Reply
#3
Buttons call a function, which would increment the progress bar, if that is what you want. Your buttons do not call a function.
Reply
#4
(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.
Reply
#5
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/
Reply


Forum Jump:

User Panel Messages

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