Python Forum
[Tkinter] ttk.barprogress - root.mainloop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] ttk.barprogress - root.mainloop
#11
(Apr-08-2019, 09:29 PM)metulburr Wrote: I havent done tkinter in a long time. So i am very rusty with placement. But you are assinging the same widget to the same cell pushing the buttons to the right. I would explicitly state row and column for each. Such as

        imagetest = PhotoImage(file="house.png")
        button_qwer = tk.Button(image = imagetest, command=self.start_progbar1)
        button_qwer.grid(row=1, column=2)
 
        imagetest1 = PhotoImage(file="house.png")
        button_qwer = tk.Button(image = imagetest1, command=self.start_progbar2)
        button_qwer.grid(row=1, column=3)
 
        imagetest2 = PhotoImage(file="house.png")
        button_qwer = tk.Button(image = imagetest2, command=self.start_progbar3)
        button_qwer.grid(row=1, column=4)
         
        self.root.mainloop()
  
    def start_progbar1(self):
        self.progbar1 = ttk.Progressbar(orient=tk.HORIZONTAL, mode='determinate', variable=self.step)
        self.progbar1.grid(row=2, column=5)
 
        for x in range(1,120):
          self.step.set(x)
          time.sleep(0.1)
          self.root.update()
        self.progbar1.destroy()
        if True:
          word()
 
    def start_progbar2(self):
        self.progbar2 = ttk.Progressbar(orient=tk.HORIZONTAL, mode='determinate', variable=self.step)
        self.progbar2.grid(row=3, column=5)
 
        for x in range(1,120):
          self.step.set(x)
          time.sleep(0.1)
          self.root.update()
        self.progbar2.destroy()
        if True:
            powerpoint()
 
    def start_progbar3(self):
      if True:
        self.progbar3 = ttk.Progressbar(orient=tk.HORIZONTAL, mode='determinate', variable=self.step)
        self.progbar3.grid(row=4, column=5)
If you wanted to move it down to the bottom, i would suspect you would put it in a frame (just the progressbars and not the buttons) and assign that to the bottom. You can assign empty frames to use as a spacer to get to the bottom until your actually put something in the middle. (if i recall correctly). I would also split up your class. Because buttons are not progressbars and hence if you want to the move the class to the bottom, you would then be moving the buttons as well.
This is the close i got, not the final project i wanted, but is working. Many thanks mettulbur, i will take your advice in consideration and when possible try to execute it. Right now i have to finalize the program, because this is for people that have difficulty using computers, it will provide help to them, everything in one place, on a button click.

Attached Files

Thumbnail(s)
   
Reply


Messages In This Thread
RE: ttk.barprogress - root.mainloop - by Larz60+ - Apr-08-2019, 06:10 PM
RE: ttk.barprogress - root.mainloop - by metulburr - Apr-08-2019, 09:29 PM
RE: ttk.barprogress - root.mainloop - by francisco_neves2020 - Apr-09-2019, 07:19 AM
RE: add loading bar - press button - by Larz60+ - Apr-07-2019, 10:28 PM
RE: ttk.barprogress - root.mainloop - by Larz60+ - Apr-08-2019, 05:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TKinter restarting the mainloop when button pressed zazas321 7 16,454 Jan-26-2021, 06:38 AM
Last Post: zazas321
  [Tkinter] Is mainloop() necessary? escape_freedom13 2 12,754 Sep-01-2019, 02:49 PM
Last Post: escape_freedom13
  [Tkinter] sleep(n) not working inside tkinter mainloop roger31415 2 5,218 Jul-14-2019, 06:57 PM
Last Post: wuf
  [split] What is a GUI's mainloop ? kom2 1 2,787 May-04-2019, 01:58 PM
Last Post: Yoriz
  [Tkinter] How to update the gui in a loop without blocking the gui mainloop Qnuba 2 65,667 Nov-12-2016, 04:33 PM
Last Post: Qnuba

Forum Jump:

User Panel Messages

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