2006-07-22 11:54:27 +02:00
|
|
|
from sugar.scene.Actor import Actor
|
|
|
|
|
|
|
|
class Group(Actor):
|
|
|
|
def __init__(self):
|
|
|
|
self._actors = []
|
2006-07-22 12:28:59 +02:00
|
|
|
self._layout_manager = None
|
2006-07-22 11:54:27 +02:00
|
|
|
|
|
|
|
def add(self, actor):
|
|
|
|
self._actors.append(actor)
|
2006-07-22 12:28:59 +02:00
|
|
|
if self._layout_manager:
|
|
|
|
self._layout_manager.layout_group(slef)
|
2006-07-22 11:54:27 +02:00
|
|
|
|
|
|
|
def remove(self, actor):
|
|
|
|
self._actors.remove(actor)
|
2006-07-22 12:28:59 +02:00
|
|
|
if self._layout_manager:
|
|
|
|
self._layout_manager.layout_group(self)
|
|
|
|
|
|
|
|
def get_actors(self):
|
|
|
|
return self._actors
|
|
|
|
|
|
|
|
def set_layout_manager(self, layout_manager):
|
|
|
|
self._layout_manager = layout_manager
|
|
|
|
self._layout_manager.layout_group(self)
|
2006-07-22 11:54:27 +02:00
|
|
|
|
|
|
|
def render(self, drawable):
|
|
|
|
for actor in self._actors:
|
|
|
|
actor.render(drawable)
|