sugar-toolkit-gtk3/sugar/scene/Group.py

33 lines
596 B
Python
Raw Normal View History

from sugar.scene.Actor import Actor
class Group(Actor):
def __init__(self):
self._actors = []
2006-07-22 13:48:47 +02:00
self._layout = None
def add(self, actor):
self._actors.append(actor)
2006-07-22 13:48:47 +02:00
self.do_layout()
def remove(self, actor):
self._actors.remove(actor)
2006-07-22 13:48:47 +02:00
self.do_layout()
2006-07-22 12:28:59 +02:00
def get_actors(self):
return self._actors
2006-07-22 13:48:47 +02:00
def set_layout(self, layout):
self._layout = layout
self.do_layout()
def get_layout(self):
return self._layout
def do_layout(self):
if self._layout:
self._layout.layout_group(self)
def render(self, drawable):
for actor in self._actors:
actor.render(drawable)