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

23 lines
511 B
Python
Raw Normal View History

2006-07-24 12:15:52 +02:00
import gtk
from sugar.scene.Stage import Stage
class StageView(gtk.Fixed):
2006-07-24 12:15:52 +02:00
def __init__(self, stage):
gtk.Fixed.__init__(self)
self.set_has_window(True)
2006-07-24 12:15:52 +02:00
self._stage = stage
self._stage.connect('changed', self.__stage_changed_cb)
self.connect('expose_event', self.__expose_cb)
def __stage_changed_cb(self, stage):
if self.window:
self.window.invalidate_rect(None, False)
def __expose_cb(self, widget, event):
self._stage.render(widget.window)
def get_stage(self):
return self._stage