(self, *args)
| 450 | self.canvas.update_idletasks() |
| 451 | |
| 452 | def paint(self, *args): |
| 453 | totalWidth = self.canvas.winfo_width() |
| 454 | width = int(self.fraction * float(totalWidth)) |
| 455 | height = self.canvas.winfo_height() |
| 456 | if self.rect is not None: self.canvas.delete(self.rect) |
| 457 | if self.text is not None: self.canvas.delete(self.text) |
| 458 | self.rect = self.canvas.create_rectangle(0, 0, width, height, |
| 459 | fill=self.color) |
| 460 | percentString = "%3.0f%%" % (100.0 * self.fraction) |
| 461 | self.text = self.canvas.create_text(totalWidth/2, height/2, |
| 462 | anchor=tk.CENTER, |
| 463 | text=percentString) |
| 464 | |
| 465 | def main(initialTestName=""): |
| 466 | root = tk.Tk() |
no test coverage detected