MCPcopy Index your code
hub / github.com/csev/py4e / draw

Method draw

code/graphics/graphics.py:453–467  ·  view source on GitHub ↗

Draw the object in graphwin, which should be a GraphWin object. A GraphicsObject may only be drawn into one window. Raises an error if attempt made to draw an object that is already visible.

(self, graphwin)

Source from the content-addressed store, hash-verified

451 self._reconfig("width", width)
452
453 def draw(self, graphwin):
454
455 """Draw the object in graphwin, which should be a GraphWin
456 object. A GraphicsObject may only be drawn into one
457 window. Raises an error if attempt made to draw an object that
458 is already visible."""
459
460 if self.canvas and not self.canvas.isClosed(): raise GraphicsError, OBJ_ALREADY_DRAWN
461 if graphwin.isClosed(): raise GraphicsError, "Can't draw to closed window"
462 self.canvas = graphwin
463 #self.id = self._draw(graphwin, self.config)
464 self.id = _tkCall(self._draw, graphwin, self.config)
465 if graphwin.autoflush:
466 #_root.update()
467 _tkCall(_root.update)
468
469 def undraw(self):
470

Callers 3

testFunction · 0.80
histogram.pyFile · 0.80
Chart.bundle.jsFile · 0.80

Calls 2

_tkCallFunction · 0.85
isClosedMethod · 0.80

Tested by

no test coverage detected