I'm having some trouble understanding the Progressbar
widget in tkinter (python 2.7) I went here and here but I still don't understand how to link the Progressbar
itself (in "determinate" mode) to my functions.
Does anyone have any examples on how to link the completion of functions to the progress-bar updating?
Please don't down-vote for lack of research; I did research on this, I just can't find any helpful information. A note on my (already working) code - a .txt file is created as the code runs that prints the total number of functions and the current function that is being run. I would like to link the progressbar
with the information in these .txt files.
EDIT: More specifically, how do I get value to change to be the correct number?
Working example - you can see current value and max value in both types progressbars.
--
You can use
self.var_ind.set()
orself.var_det.set()
in your function (inside classMainWindow
) to update progressbar.--
If your function is outside class you have to call it with
self.var_ind
orself.var_det
as argument.and inside function use it
I use
var_ind.set()
andself.var_det.set()
inBEGIN
,SET 23
,END
to set new value.--
If you have to set
max
in progressbar you will need addself.pbar_ind
orself.pbar_det
as argument too.and inside function use it
EDIT: new example with more buttons:
(To create example I used part of code from Gianni Spear question Using the same progressbar in tkinter for several computation in Python)