peng3d.util - Utility Functions and Classes

class peng3d.util.WatchingList(l, callback=<function <lambda>>)[source]

Subclass of list() implementing a watched list.

A WatchingList will call the given callback with a reference to itself whenever it is modified. Internally, the callback is stored as a weak reference, meaning that the creator should keep a reference around.

This class is used in peng3d.gui.widgets.BasicWidget() to allow for modifying single coordinates of the pos and size properties.