We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

Tkinter 3000 SimpleRightArrow Widget

May 9, 2001 | Fredrik Lundh

The demoSimpleRightArrow module contains a minimal widget implementation. The widget class overrides a single method, ui_handle_repair.

File: demoSimpleRightArrow.py
from WCK import Widget

class SimpleRightArrow(Widget):
    # minimal widget implementation

    def ui_handle_repair(self, draw, x0, y0, x1, y1):
        brush = self.ui_brush("black")
        xy = (x0, y0, x1, (y0+y1)/2, x0, y1)
        draw.polygon(xy, brush)

The WCK framework provides standard methods to handle things like widget creation, configuration management, and resizing. The framework also draws the background before calling the repair method.