MCPcopy Index your code
hub / github.com/python/cpython / paint

Method paint

Tools/unittestgui/unittestgui.py:452–463  ·  view source on GitHub ↗
(self, *args)

Source from the content-addressed store, hash-verified

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
465def main(initialTestName=""):
466 root = tk.Tk()

Callers 1

setProgressFractionMethod · 0.95

Calls 5

winfo_widthMethod · 0.80
winfo_heightMethod · 0.80
create_rectangleMethod · 0.80
create_textMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected