easygraphics.widget package

The qt widget package.

This package provides two qt widget classes, for embeding easygraphics image or turtle graphics in qt applications:

  • ImageWidget: this class is for embedding easygraphics image in qt applications. No animation support
  • TurtleWidget: this class is for embedding turtle graphics in qt applications. Can run animation code (using run_animated_code() method).


class easygraphics.widget.ImageWidget(parent=None)
getImage() → easygraphics.image.Image

Get the underlying image object.

Returns:the underlying image object
paintEvent(e: <sphinx.ext.autodoc.importer._MockObject object at 0x7f533f067f28>)
setImage(image: easygraphics.image.Image)

Set the widget’s underlying Image object.

Parameters:image – the underlying image object
class easygraphics.widget.TurtleWidget(parent=None, width=600, height=400)

Close the widget.

closeEvent(e: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5345004a20>)
getTurtle() → easygraphics.turtle.turleclass.Turtle

Get the turtle.

Returns:the turtle
getWorld() → easygraphics.turtle.turleclass.TurtleWorld

Get the underlying turtle world.

Returns:the turtle world

Test if the turtle world is running.

Returns:True if is running, False if not.
paintEvent(e: <sphinx.ext.autodoc.importer._MockObject object at 0x7f5345004a20>)

Run turtle code.

Parameters:f – the callable object(function or method) to run