0
votes

I am currently creating a program with a loading bar (Tkinter ProgressBar) in Tkinter. The problem is - that using tkinter.ttk is a pain - I have to change pretty much all of my code using that method, and seeming as I am fairly new to Tkinter, it isn't ideal to do so. Is there any other way of using the progressbar widget without the tkinter.ttk module?

(If I had to use the tkinter.ttk module I would have to spend hours sifting through my code and changing it - which I don't want to do!!)

Many thanks in advance!

1
Why not do import tkinter.ttk as tk?xilpex
@Xilpex How and would that allow me to use the ProgressBar still? The main thing I have to change is the background widgets of frame widgets - would these foreground/background variables in my other tkinter widgets that aren't ttk be affected? (could I keep other Tkinter widgets with the standard background="blue" code as they are?)SnappyPenguin
You can use tkinter and tkinter.ttk in the same code, they're not mutually exclusive of each other and using widgets from both is quite common. Almost every GUI app I write begins with import tkinter as tk and from tkinter import ttk, allowing tkinter widgets to be used as tk.widget and ttk widgets as ttk.widget.tgikal

1 Answers

1
votes

Tkinter doesn't have a progress bar except through ttk.

If you find tkinter.ttk.progressbar too difficult, just change how you import it.

For example:

from tkinter.ttk import Progressbar
...
pb = Progressbar(...)

or this, which I think is the better solution:

from tkinter import ttk
...
pb = ttk.Progressbar(...)